web based ftp
Posted 15 June 2006 - 04:03 PM
I am trying to create a web based ftp client for my clients. The ftp part is kewl now but i dont know how to bring up the "browse your pc box" to allow the user to select where they would like the file to be downloaded. Can anyone help. If you can you are the MAN (or for that matter the WOMAN) thanks in advance
Posted 15 June 2006 - 04:07 PM
[a href=\"http://www.cs.tut.fi/~jkorpela/forms/file.html\" target=\"_blank\"]http://www.cs.tut.fi/~jkorpela/forms/file.html[/a]
<form action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi" enctype="multipart/form-data" method="post"> <p> Type some text (if you like):<br> <input type="text" name="textline" size="30"> </p> <p> Please specify a file, or a set of files:<br> <input type="file" name="datafile" size="40"> </p> <p> <input type="submit" value="Send"> </p> </form>
Posted 15 June 2006 - 04:21 PM
but its not going to work.
the user need to be able to select a directory to download into, <input type='file'> is for uploading files so you have to select a file.
Posted 15 June 2006 - 04:36 PM
It's in the headers...
[a href=\"http://www.php.net/header\" target=\"_blank\"]http://www.php.net/header[/a]
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]If you want the user to be prompted to save the data you are sending, such as a generated PDF file, you can use the Content-Disposition header to supply a recommended filename and force the browser to display the save dialog. [/quote]
<?php // We'll be outputting a PDF header('Content-type: application/pdf'); // It will be called downloaded.pdf header('Content-Disposition: attachment; filename="downloaded.pdf"'); // The PDF source is in original.pdf readfile('original.pdf'); ?>
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users