Jump to content

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
Link to comment
https://forums.phpfreaks.com/topic/12079-web-based-ftp/
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]
Link to comment
https://forums.phpfreaks.com/topic/12079-web-based-ftp/#findComment-45963
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]
Link to comment
https://forums.phpfreaks.com/topic/12079-web-based-ftp/#findComment-45983
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.