upload php error

upload php error

Posted by: Mojo36
Posted on: 2007-03-02 03:50:00

When trying to upload an image onto the grid in my website I receive this error message. I've no idea what it means or how to correct the fault. Can anyone advise immediately as its been happening for 2 weeks!

Warning: move_uploaded_file(adverts/3276e7191e11a9d5207fc1604a10d96djpg) [function.move-uploaded-file]: failed to open stream: Permission denied in /home/artscraf/public_html/upload.php on line 29

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpG7cwzJ' to 'adverts/3276e7191e11a9d5207fc1604a10d96djpg' in /home/artscraf/public_html/upload.php on line 29




Re: upload php error

Posted by: nathan823
Posted on: 2007-03-02 05:31:00

Are your files in the right folder? The web pages should reside inside "yourdomain.com" folder. I don't know how you access the php file. But I think the path should be something like /home/artscraft/yourdomain.com/yourfolder/yourfile

not sure about that. If your files are in the right folder, you can want to try these codes to set the upload folder.

$uploadFolder=getcwd()."/upload/"; //this is the folder where the uploaded images reside

Re: upload php error

Posted by: Mojo36
Posted on: 2007-03-02 06:07:00

Hi, Thanks for your reply but I'm really computer illiterate. Could you put it into a, b, c, step by step instructions as I don't want to damage any of the scripting. Thanks

Re: upload php error

Posted by: nathan823
Posted on: 2007-03-02 17:08:00

first, make sure that your files are inside "yourdomain.com" folder.

second, you can try these codes.

$uploadFolder=getcwd()."/upload/";

if (file_exists($_FILES["file"]["name"])){
echo $_FILES["file"]["name"]." already exists.";
}else{
move_uploaded_file($_FILES["file"]["tmp_name"], $uploadFolder.$_FILES["file"]["name"]);
echo "Stored in: ".$uploadFolder.$_FILES["file"]["name"];
}

hope it helps.

Re: upload php error

Posted by: Mojo36
Posted on: 2007-03-05 05:41:00

Thanks for the reply but where do I put the codes you've suggested? I did say I was computer illiterate (and probably can't spell!!)

Re: upload php error

Posted by: Raz2133
Posted on: 2007-03-05 05:51:00

Going back to your original problem for a second...

What scripts/application are you using to upload the images?

Is the problem occurring with all images or only some images?

How large are the images? The default DreamHost PHP installs limit PHP uploads to around 7Mbyte.

Has the problem always occurred, or were things working correctly until recently?


Mark

Re: upload php error

Posted by: Mojo36
Posted on: 2007-03-05 07:37:00

I'm not sure what the script/ application is I'm using.

The images that are already on the grid are fine but any new ones I try to place I get the error message from before.

Most images are fairly small - the largest is 10k - about 300 x 200 pixels.

The problem has only started recently - begining of February 2007.

We have compared our original script to a new script for an identical site and there doesn't seem to be anything obvious wrong with it. Could it be that the host has blocked the images being uploaded for some reasons i.e security. The host is not responding to any of our emails either which rings alarm bells straight away.



Re: upload php error

Posted by: Raz2133
Posted on: 2007-03-05 07:45:00

In reply to:

The problem has only started recently - begining of February 2007.


If things were working previously, then just stopped working without you having made any changes to your site, then I suggest you contact support via the support section of the admin panel and explain the situation.

In reply to:

The host is not responding to any of our emails either which rings alarm bells straight away.


You are hosted with DreamHost right?


Mark

Re: upload php error

Posted by: nathan823
Posted on: 2007-03-05 17:02:00

In reply to:

The problem has only started recently - begining of February 2007


If the problem happens recently, nothing is wrong with the script.

You may want to checke whether anybody modified the code. Another thing, can you check the codes, there is a missing fullstop between the file name and extension name.
'adverts/3276e7191e11a9d5207fc1604a10d96djpg'

Tags: uploadedupload phpadvertsphp erroropen streampermission deniederror messagetmp