Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Query in downloading from server

  Asked By: Nichole    Date: Jun 11    Category: Java    Views: 584

Actually I have to download some backedup file
from a server to local machine when the form is being submitted.I
have no idea about it.The code can be in any Web Technologies
(JSP,Servlet,Cold Fusion).



1 Answer Found

Answer #1    Answered By: Gorkem Yilmaz     Answered On: Jun 11

> from a server  to local  machine when the form  is being submitted.I
> have no idea  about it.The code  can be in any web  Technologies
> (JSP,Servlet,Cold Fusion).If u have any idea send me in reply.


if (isset($_POST['filename']) )


else {


that is one way, however include will display the file, probably not what you
want. this is probbaly better:

header("Content-Disposition: attachment; filename=" . $downloadfile);
$datafile = fopen("$downloadfile","r");
$data = fread($datafile, 1000000);
echo $data;

You will of course have to add a loop os that $data become $data = $data + more
read data.

Didn't find what you were looking for? Find more on Query in downloading from server Or get search suggestion and latest updates.