poizn Posted June 15, 2006 Share Posted June 15, 2006 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 Quote Link to comment https://forums.phpfreaks.com/topic/12079-web-based-ftp/ Share on other sites More sharing options...
poirot Posted June 15, 2006 Share Posted June 15, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/12079-web-based-ftp/#findComment-45963 Share on other sites More sharing options...
poizn Posted June 15, 2006 Author Share Posted June 15, 2006 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 :) Quote Link to comment https://forums.phpfreaks.com/topic/12079-web-based-ftp/#findComment-45973 Share on other sites More sharing options...
poirot Posted June 15, 2006 Share Posted June 15, 2006 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 PDFheader('Content-type: application/pdf');// It will be called downloaded.pdfheader('Content-Disposition: attachment; filename="downloaded.pdf"');// The PDF source is in original.pdfreadfile('original.pdf');?> [/code] Quote Link to comment https://forums.phpfreaks.com/topic/12079-web-based-ftp/#findComment-45983 Share on other sites More sharing options...
poizn Posted June 19, 2006 Author Share Posted June 19, 2006 kewl shot for the help poirot Quote Link to comment https://forums.phpfreaks.com/topic/12079-web-based-ftp/#findComment-47236 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.