Jump to content


Photo

web based ftp


  • Please log in to reply
4 replies to this topic

#1 poizn

poizn
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts

Posted 15 June 2006 - 04:03 PM

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

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 15 June 2006 - 04:07 PM

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]

<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>

~ D Kuang

#3 poizn

poizn
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts

Posted 15 June 2006 - 04:21 PM

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 :)

#4 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 15 June 2006 - 04:36 PM

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]

<?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');
?>  

~ D Kuang

#5 poizn

poizn
  • Members
  • PipPipPip
  • Advanced Member
  • 30 posts

Posted 19 June 2006 - 09:04 AM

kewl shot for the help poirot




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users