This is a discussion on "file uploads" within the PHP Forum section. This forum, and the thread "file uploads are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
file uploads
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
file uploads
hey guys, i have a webhosting account with webhostingbuzz.com, and i am trying to do a simple script where you upload a jpeg. when i tried it out, the site gave me this error:
Warning: move_uploaded_file([where i want it to go])[function.move-uploaded-file]:failed to open stream:HTTP wrapper does not support writeable connections in [my source file] on line 13. here is my code: if (move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) {... thats all thats really relevant- thats line 13. anybody know how to fix? thanks |
|
|
|
#2
|
|||
|
|||
|
Re: file uploads
I haded this error once. I think that it should be something wrong with your target path ($target_path) you have to use local path....
|
|
#3
|
|||
|
|||
|
Re: file uploads
$target_path is a variable i made- its contents is http://www.domainname.com/pics/[$_FILE['file']['name'] goes here]
i have to do something about "localpath" you say? thx |
|
#4
|
|||
|
|||
|
Re: file uploads
Are the permissions to your upload directory set to 777 ?
And btw are you trying to upload files to a server other than your own?
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
|
|
#5
|
|||
|
|||
|
Re: file uploads
no, this is all on my own server. i will check wether it is set to "777"- thanks
|
|
#6
|
||||
|
||||
|
Re: file uploads
Can we see the entire script please?
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|
|
#7
|
|||
|
|||
|
Re: file uploads
wait- so do i want it to be 777, because it was 755.. ichanged it to test it
|
|
#8
|
|||
|
|||
|
Re: file uploads
okay, that ended up getting me nowhere. here is the code for the html form where they choose the file:
<form enctype="multipart/form-data" action="mainpicsrcupdate.php" method="post"> <table align="center" bgcolor="green" cellpadding="5" cellspacing="4"> <tr><td>[FILEPATH:]</td><td><input type="file" name="mainpicsrc" id="mainpicsrc"></td></tr> <tr><td colspan="2"><input type="submit" value="[UPDATE]"></td></tr> </table> then here is the mainpicsrcupdate.php relevant part: $target_path = "http://www.domainname.com/mainpics/"; $target_path = $target_path . basename($_FILES['mainpicsrc']['name']); if ($_FILES['mainpicsrc']['type'] == "image/pjpeg") { if (move_uploaded_file($_FILES['mainpicsrc']['tmp_name'], $target_path)) {?> <h1 align="center">[UPLOAD SUCCESSFULL]</h1> <?PHP } else { ?> error occurred <?PHP } ?> thanks |
|
#9
|
|||
|
|||
|
Re: file uploads
have you tried to change the $target_path :
from
if is situated in http://www.domainname.com/admin/; $target_path should be :
|
|
#10
|
|||
|
|||
|
Re: file uploads
it worked! hardcore. thanks guys, really needed it
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Uploads Images! Need help | randy9378 | Web Page Design | 2 | Oct 23rd, 2007 19:05 |
| Multiple file uploads | robukni | PHP Forum | 12 | Sep 6th, 2007 12:49 |
| Video Uploads | Accurax | Webforumz Cafe | 32 | Mar 19th, 2007 13:11 |
| Allowing Customer Uploads? Help! | gingermop | Hosting & Domains | 3 | May 10th, 2006 11:09 |