FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


php upload issue





Mental2k
I am writing a small upload script in php, at the moment I am only testing it on my server at home, so I have no loaded it onto the frihost server yet. However I run into the following error messages when doing it


move_uploaded_file($HTTP_POST_FILES['comic']['tmp_name'],'http://localhost/upload/uploads/'.$HTTP_POST_FILES['comic']['name']);

Gives error;

Warning: move_uploaded_file(http://localhost/upload/uploads/Comic0007.jpg) [function.move-uploaded-file]: failed to open stream: HTTP wrapper does not support writeable connections. in c:\webs\upload\po.php on line 13

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\php5.tmp' to 'http://localhost/upload/uploads/Comic0007.jpg' in c:\webs\upload\po.php on line 13




move_uploaded_file($HTTP_POST_FILES['comic']['tmp_name'],'/upload/uploads/'.$HTTP_POST_FILES['comic']['name']);

Gives error;

Warning: move_uploaded_file(/upload/uploads/Comic0007.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in c:\webs\upload\po.php on line 13

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\WINDOWS\php9.tmp' to '/upload/uploads/Comic0007.jpg' in c:\webs\upload\po.php on line 13



move_uploaded_file($HTTP_POST_FILES['comic']['tmp_name'],'c:\webs\upload\uploads\\'.$HTTP_POST_FILES['comic']['name']);

Works fine.


Shouldn't there be a way to make this work with a server address instead of the directory on my hard drive?

Also how does this translate to using a proper server online?


Also this is the 1337th topic in this forum.
Traveller
Mental2k wrote:
move_uploaded_file($HTTP_POST_FILES['comic']['tmp_name'],'http://localhost/upload/uploads/'.$HTTP_POST_FILES['comic']['name']);

Gives error;

Warning: move_uploaded_file(http://localhost/upload/uploads/Comic0007.jpg) [function.move-uploaded-file]: failed to open stream: HTTP wrapper does not support writeable connections. in c:\webs\upload\po.php on line 13


The destination filename for move_uploaded_file() must be a filename, and not a URL.
Mental2k
right oh, so how does this work if i put it on frihosts servers (note I havent tried this, so dont flame me if its excruciatingly obvious)
Related topics
Build an online dictionary by PHP/MySQL
HUGE FREE LINK EXCHANGE!!
Java tutorials
I need a php upload script, NEEDED BADLY
[PHP] Upload de arquivos
php upload problems
Php upload scripti arýyorum..
php upload problem
PHP upload Max
How to build simple PHP upload form
HTTP Fileupload and CHMOD
PHP Sessions Issue
is there a good upload/download script?
PHP directory issue
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.