Jump to content

Archived

This topic is now archived and is closed to further replies.

poizn

web based ftp

Recommended Posts

Hi all

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

Share this post


Link to post
Share on other sites
Read this:
[a href=\"http://www.cs.tut.fi/~jkorpela/forms/file.html\" target=\"_blank\"]http://www.cs.tut.fi/~jkorpela/forms/file.html[/a]

[code]<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>[/code]

Share this post


Link to post
Share on other sites
thanks for the reply :)

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.

thanks anyway :)

Share this post


Link to post
Share on other sites
Oh... Just output the download instead of the file.

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]

[code]<?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');
?>  [/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.