Problem to open / import file in textarea (SOLVED)

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" />&nbsp;&nbsp;&nbsp;<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?

I’m using the chromium engine

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?

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

It seems to be my solution :slight_smile:

I will test some different files now. Many thanks!

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>