proseox
October 15, 2012, 1:25pm
#1
On localhost webserver its working , in exe file it isnt.
I can import textfiles and show them in a textarea with the following code:
My readfile.php
<form action="index.php" method="POST">
<input name="file" type="file" /> <input type="submit" value="Import File" />
</form>
My showfile.php contains this
<textarea name="txtscript" id="txtscript" cols="45" rows="15"><?php echo htmlspecialchars($script); ?><?php $filename = $_POST'file']; $file = fopen($filename, "r"); echo htmlspecialchars(fread($file, filesize($filename))); fclose($file); ?></textarea><br />
on localhost i have no problems but in the exe the textarea is empty
Which engine are you using? Trident or Chromium?
proseox
October 15, 2012, 11:40pm
#3
I’m using the chromium engine
proseox
October 17, 2012, 10:50am
#4
Can you help with my problem? It’s really important.
The POST method has some problems in ExeOutput 1.5 with Chromium. Have you tried the v1.6 Beta?
proseox
October 21, 2012, 5:18pm
#6
I have tested now with trident and it is not working too. If i import a file which is compiled too the import works, but if i take a other file it doesnt work.
Is there a need to write something in the scripting box like for export / saving files?
Well, if you want to let the user select a file from his computer and read it with PHP, you should avoid the form method, and use the HEScript approach. See this topic:
http://www.exeoutput.com/help/choosingfilesupload.htm
Selecting files with PHP scripts in local applications - Upload replacement
proseox
October 24, 2012, 6:01pm
#8
It seems to be my solution
I will test some different files now. Many thanks!
proseox
October 24, 2012, 6:19pm
#9
OK. If anyone needs this too…
I import a script and put the content to a textarea.
UserMain Scripting
function OpenDlgFile: String;
begin
Result := OpenFileDialog("Select a File to open", "*.*", "*.*", "All files (*.*)|*.*", "");
end;
My PHP file contains this
<?php
echo '<a class="Buttonlookalike" href="index.php?name=import">Import</a> ';
if ($_GET'name']=="import") {
$filename = exo_return_hescriptcom("UserMain.OpenDlgFile", "Error");
$import = file_get_contents($filename);
}
?>
<textarea><?php echo htmlspecialchars($import); ?></textarea>