Hello, I have that code (index.html): <input type="file" name="file"> Code (markup): by which I select file from my PC (to upload). I don't want select file from my PC but I want upload file from my server (for example file.exe). How to do it? Folder Structure Example: /public_html/ -index.html -file.exe
That's gonna be a little more difficult than your code... 1) Generate a list of all available files on your server. Using PHP seems good. <? //define the path as relative $path = "/home/yoursite/public_html/whatever"; //using the opendir function $dir_handle = @opendir($path) or die("Unable to open $path"); echo "Directory Listing of $path<br/>"; //running the while loop while ($file = readdir($dir_handle)) { echo "<a href='$file'>$file</a><br/>"; } //closing the directory closedir($dir_handle); ?> Code (markup): 2) Have the user select one file. I'd recommend radio buttons, but this will get terribly messy with more than 10 files, so you should think of something else, depending on your site design and purpose. 3) Submit the file name to a PHP script, which does stuff with the file.