Welcome! Log In Create A New Profile

Advanced

Freewebhostingarea.com uploading files

Posted by 48732028Lehan 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Freewebhostingarea.com uploading files
October 18, 2012 08:34PM
Hi,

I'm trying to upload files to my server via a form and the php move_uploaded_file function but whenever I try to execute it nothing happens. I enabled error logging using ini_set('display_errors',1); error_reporting(E_ALL); and I get the following two errors:

Warning: move_uploaded_file(dvdPics/0/pic1.jpg): failed to open stream: Permission denied in /home/vhosts/48732028.6te.net/insert.php on line 45

Warning: move_uploaded_file(): Unable to move '/tmp/phpaOsRwi' to 'dvdPics/0/pic1.jpg' in /home/vhosts/48732028.6te.net/insert.php on line 45

I tried the same code on another server and it seemed to work, it seems to be an issue specifically with freewebhostingarea.com.

Does anyone know how I can fix this?
avatar
Mac
Re: Freewebhostingarea.com uploading files
October 19, 2012 07:59AM
Only they would be able to help with permission problems, and of course they will no because you are using the free service, so use another server or account. That said, it could simply be a path problem in your code on line 45.
Re: Freewebhostingarea.com uploading files
October 19, 2012 08:03AM
I wish I could but the other hosting sites seems to block other features I need. 000webhost seems to be the best as they support everything I need, even email except the function we need for the assignments where there needs to be a text file that opens on the page with your code, that feature seems to be blocked for some reason. How can I double check that I am using the correct path?
avatar
Mac
Re: Freewebhostingarea.com uploading files
October 19, 2012 08:13AM
They cannot block the text file - other people have used it so it is your code. I cannot say what your path must be because I do not know what you have coded and your directory structure. Google for "move_uploaded_file not working" and see if you can pinpoint issues e.g. http://forums.phpfreaks.com/topic/232311-move-uploaded-file-not-working/
Re: Freewebhostingarea.com uploading files
October 19, 2012 08:25AM
Ok so I tried 000webhost and as I said before it is definitely blocking text files, trying to open the link Chrome gives me: Oops! This link appears to be broken. I have the exact same code on another server which works perfectly.

000webhost: http://48732028.net16.net/ (not working)
Zymic: http://48732028.zxq.net/ (working)
Re: Freewebhostingarea.com uploading files
October 19, 2012 09:10AM
I'm 100% sure they don't block text files, if you are 100% sure your path is correct, take a look at the permissions?
Re: Freewebhostingarea.com uploading files
October 19, 2012 09:15AM
Hi 49459635,

I have checked that all the files that need additional permissions have been set to 755. Have you tried using the text files on 000webhost? If so could you maybe send me a link or a code excerpt of what worked for you?
Re: Freewebhostingarea.com uploading files
October 19, 2012 12:54PM
I must be stupid or something but I can't get 000webhost to open a text file. Can we make the text file an html file with the code embedded in <xmp></xmp> tags or will I lose marks?
avatar
Mac
Re: Freewebhostingarea.com uploading files
October 19, 2012 01:35PM
As you wish - I just need to see the code. You can also just change the opening tags from <?php and ?> to < ?php and ? > which means the server will not intepret the code.
Re: Freewebhostingarea.com uploading files
October 19, 2012 04:28PM
Thanks Mr van der Merwe.
Sorry, only registered users may post in this forum.

Click here to login