Re: [PHP] File uploads and handling
[embarrassment] Thanks all. Of course it was a dumb thing I was doing. I didn't give the absolute path when "moving" the uploaded file. I got it to work though! [/embarrassment] ~Philip On Oct 28, 2004, at 9:40 PM, Robby Russell wrote: On Thu, 2004-10-28 at 19:04 -0500, Philip Thompson wrote: On Oct 26, 2004, at 7:06 AM, Jason Wong wrote: On Tuesday 26 October 2004 03:45, Philip Thompson wrote: I have a form to upload a file from a user's computer to the server. I want to then modify the file, and then let the user save it back. However, I am having troubles opening the file. It says it doesn't exist. Any suggestions? --- if (is_uploaded_file($_FILES['userfile']['name'])) $handle = fopen($_FILES['userfile']['name'], "r"); else echo $filename . " was not uploaded properly"; --- I know the actual filename shows up... In the above you are only referencing the *filename* and not the actual uploaded file itself. but somehow it's not uploading. Ideas? Read manual > Handling file uploads to see how it all works. Yeah, that was not useful at all. That's what I originally looked at. If anyone has some "code" that shows how to reference the actual file, then that would be helpful. I have pulled my hair out long enough over this one. I did try this, but nothing changed (b/c it's just an array): if (is_uploaded_file(_FILES['userfile'])) $handle = fopen($_FILES['userfile'], "r"); Tips would be wonderful. Thanks! Here is an example: http://blog.planetargon.com/index.php?/archives/ 26_Uploading_images_into_PostgreSQL.html hth, Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting & Development *--- Now supporting PHP5 --- / -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File uploads and handling
On Thu, 2004-10-28 at 19:04 -0500, Philip Thompson wrote: > On Oct 26, 2004, at 7:06 AM, Jason Wong wrote: > > > On Tuesday 26 October 2004 03:45, Philip Thompson wrote: > > > >> I have a form to upload a file from a user's computer to the server. I > >> want to then modify the file, and then let the user save it back. > >> However, I am having troubles opening the file. It says it doesn't > >> exist. Any suggestions? > >> > >> --- > >> if (is_uploaded_file($_FILES['userfile']['name'])) > >> $handle = fopen($_FILES['userfile']['name'], "r"); > >> else > >> echo $filename . " was not uploaded properly"; > >> --- > >> > >> I know the actual filename shows up... > > > > In the above you are only referencing the *filename* and not the actual > > uploaded file itself. > > > >> but somehow it's not uploading. > >> Ideas? > > > > Read > > > > manual > Handling file uploads > > > > to see how it all works. > > Yeah, that was not useful at all. That's what I originally looked at. > If anyone has some "code" that shows how to reference the actual file, > then that would be helpful. I have pulled my hair out long enough over > this one. > > I did try this, but nothing changed (b/c it's just an array): > > if (is_uploaded_file(_FILES['userfile'])) > $handle = fopen($_FILES['userfile'], "r"); > > Tips would be wonderful. Thanks! Here is an example: http://blog.planetargon.com/index.php?/archives/26_Uploading_images_into_PostgreSQL.html hth, Robby -- /*** * Robby Russell | Owner.Developer.Geek * PLANET ARGON | www.planetargon.com * Portland, OR | [EMAIL PROTECTED] * 503.351.4730 | blog.planetargon.com * PHP/PostgreSQL Hosting & Development *--- Now supporting PHP5 --- / signature.asc Description: This is a digitally signed message part
Re: [PHP] File uploads and handling
On Thu, 28 Oct 2004 19:04:27 -0500, Philip Thompson <[EMAIL PROTECTED]> wrote: > > manual > Handling file uploads > > > > to see how it all works. > > Yeah, that was not useful at all. That's how the rest of us learned. The examples on the page is pretty clear to me. > That's what I originally looked at. > If anyone has some "code" that shows how to reference the actual file, > then that would be helpful. I have pulled my hair out long enough over > this one. > > I did try this, but nothing changed (b/c it's just an array): > > if (is_uploaded_file(_FILES['userfile'])) > $handle = fopen($_FILES['userfile'], "r"); $_FILES['userfile']['name'] is the file. $_FILES['userfile']['tmp_name'] is the name of the file. $_FILES['userfile'] is as you stated 'just an array'. It's all right there in the manual. http://php.net/manual/en/features.file-upload.php -- Greg Donald Zend Certified Engineer http://gdconsultants.com/ http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File uploads and handling
On Oct 26, 2004, at 7:06 AM, Jason Wong wrote: On Tuesday 26 October 2004 03:45, Philip Thompson wrote: I have a form to upload a file from a user's computer to the server. I want to then modify the file, and then let the user save it back. However, I am having troubles opening the file. It says it doesn't exist. Any suggestions? --- if (is_uploaded_file($_FILES['userfile']['name'])) $handle = fopen($_FILES['userfile']['name'], "r"); else echo $filename . " was not uploaded properly"; --- I know the actual filename shows up... In the above you are only referencing the *filename* and not the actual uploaded file itself. but somehow it's not uploading. Ideas? Read manual > Handling file uploads to see how it all works. Yeah, that was not useful at all. That's what I originally looked at. If anyone has some "code" that shows how to reference the actual file, then that would be helpful. I have pulled my hair out long enough over this one. I did try this, but nothing changed (b/c it's just an array): if (is_uploaded_file(_FILES['userfile'])) $handle = fopen($_FILES['userfile'], "r"); Tips would be wonderful. Thanks! ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File uploads and handling
On Tuesday 26 October 2004 03:45, Philip Thompson wrote: > I have a form to upload a file from a user's computer to the server. I > want to then modify the file, and then let the user save it back. > However, I am having troubles opening the file. It says it doesn't > exist. Any suggestions? > > --- > if (is_uploaded_file($_FILES['userfile']['name'])) > $handle = fopen($_FILES['userfile']['name'], "r"); > else > echo $filename . " was not uploaded properly"; > --- > > I know the actual filename shows up... In the above you are only referencing the *filename* and not the actual uploaded file itself. > but somehow it's not uploading. > Ideas? Read manual > Handling file uploads to see how it all works. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Quantity is no substitute for quality, but its the only one we've got. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File uploads and handling
Hi all. I have a form to upload a file from a user's computer to the server. I want to then modify the file, and then let the user save it back. However, I am having troubles opening the file. It says it doesn't exist. Any suggestions? --- if (is_uploaded_file($_FILES['userfile']['name'])) $handle = fopen($_FILES['userfile']['name'], "r"); else echo $filename . " was not uploaded properly"; --- I know the actual filename shows up... but somehow it's not uploading. Ideas? ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php