Re: Automatic file upload...

From: Date: Thu, 21 Nov 2002 18:22:33 +0000
Subject: Re: Automatic file upload...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-125453@lists.php.net to get a copy of this message
Tom, It sounds like the file you want is online someplace. So, perhaps it's fread() that you want to use. With it, you can get the html output of a page. Hugh ----- Original Message ----- From: "Tom Woody" <woody@nfri.com> To: <php-general@lists.php.net> Sent: Thursday, November 21, 2002 9:28 AM Subject: [PHP] Automatic file upload... > I am trying to put together a script so that I can upload files to a > php script, with just a URL and can't seem to get my brain around it. > > For example, The browser would have a url like: > > http://example.com/upload/fileupload.php?filename=C:\filename.txt > > Is there a way to do this and I'm just missing it, or will the client > have to browse and choose the filename with a <form></form> type of > construct? > > I have tried some google searches on <input> syntax, as well as php > file uploads to no success. The simple code I have been working with > is (obviously nothing has been found for automatically submitting a > form): > > <?php > if (is_uploaded_file($_FILES['toProcess']['tmp_name'])) { > //successfully uploaded > move_uploaded_file($_FILES['toProcess']['tmp_name'], > "/var/www/html/filename.txt"); > echo "File successfully uploaded...thank you<br>\n"; > } > else { > echo "Upload Problem<br>\n"; > } > > ?> > <html> > <body> > <form enctype="multipart/form-data" action="<? $PHP_SELF; ?>" > method="POST"> > Filename: <input type="file" name="toProcess" > value="file:///home/user/uploadtest.txt"> > <input type="submit"> > </form> > </body> > </html> > > -- > Tom > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#125453) next »