error when using file upload form
Posted: Sat Feb 22, 2003 5:59 pm
Hi,
I am fairly new to PHP. I have mastered forms, but now need to add a file upload facility to one. I have searched for coding etc, and tried to apply it to my forms.
My only problem as far as I can see, is in the following line, where I tell the form where to upload the file to -
copy("$superdat", "http://www.mywebsite.com/home/mycontrol ... p/incoming /uploading/$superdat_name") or
die("Couldn't copy file.");
I can't seem to get the path/address correct, as I keep getting this message when I upload my forms and go in as a user to test them. When I click submit, this is the error that I get -
Warning: Unable to create 'http://www.mywebsite.com/home/mycontrol ... p/incoming /uploading/emaillogosmall.gif': No such file or directory in /home/mycontrolpanelloginname/public_html/upload.php on line 21
Couldn't copy file.
Of course, I have changed some of the names to put this on here. But, I think my main problem, is that in my php coding, where I have the line that tells the form where to upload the file to on my web site server, I am not putting the correct address.
The file 'uploading' has user write permissions, so that part is fine. I just can't grasp the correct way to write the actual path/address to place the file. I have tried '/public_ftp/incoming/uploading/' , I have tried 'http://www.mywebsite.com/public_ftp/incoming/uploading/' , I have tried '/home/mycontroplanelusername/public_ftp/incoming/uploading/' , and I have also tried placing the 'uploading' file just straight on my hositing directory and also in my 'public_html' file. Nothing seems to work. I am on a shared Web Hosting service, does this make a difference?
How do I correctly write the path/address on a shared Unix server?
I am fairly new to PHP. I have mastered forms, but now need to add a file upload facility to one. I have searched for coding etc, and tried to apply it to my forms.
My only problem as far as I can see, is in the following line, where I tell the form where to upload the file to -
copy("$superdat", "http://www.mywebsite.com/home/mycontrol ... p/incoming /uploading/$superdat_name") or
die("Couldn't copy file.");
I can't seem to get the path/address correct, as I keep getting this message when I upload my forms and go in as a user to test them. When I click submit, this is the error that I get -
Warning: Unable to create 'http://www.mywebsite.com/home/mycontrol ... p/incoming /uploading/emaillogosmall.gif': No such file or directory in /home/mycontrolpanelloginname/public_html/upload.php on line 21
Couldn't copy file.
Of course, I have changed some of the names to put this on here. But, I think my main problem, is that in my php coding, where I have the line that tells the form where to upload the file to on my web site server, I am not putting the correct address.
The file 'uploading' has user write permissions, so that part is fine. I just can't grasp the correct way to write the actual path/address to place the file. I have tried '/public_ftp/incoming/uploading/' , I have tried 'http://www.mywebsite.com/public_ftp/incoming/uploading/' , I have tried '/home/mycontroplanelusername/public_ftp/incoming/uploading/' , and I have also tried placing the 'uploading' file just straight on my hositing directory and also in my 'public_html' file. Nothing seems to work. I am on a shared Web Hosting service, does this make a difference?
How do I correctly write the path/address on a shared Unix server?