PHP upload issues (works on one site, not another)

PHP upload issues (works on one site, not another)

Posted by: restlessdesign
Posted on: 2006-03-19 11:21:00

Hi guys!

I have two websites on Dreamhost. One is mine, and the other is my friend's, whose website I am programming for him. He just registered a few days ago, so before that I was doing all the development on my host. Now with the exception of the database name that I'm saving the image file path locations and some other data to, the scripts are IDENTICAL. But only the one on my development site works!

The broken one (hosted on Whittier):
http://michaelmarmora.com/admin/portfolio.php

The working one (hosted on Grant):
http://kevinsweeneydesign.com/mikemarmora/admin/portfolio.php

Before you jump to any conclusions though,
1. All directories have the same permission settings
2. Both domains have PHP running as CGI
3. I've already tried renaming the jpeg MIME type to pjpeg with no success

So aside from the machines that are hosting the sites, I can see <b>NO DIFFERENCE</b> between the two. The form upload scripts are the same as well (portfolio.php)

What I am noticing, is that I can't echo out a ['tmp_file'] of the broken page, so I don't know what that could mean other than the file isn't being uploaded, but I don't know why it wouldn't be.

Please help!

Re: PHP upload issues (works on one site, not anot

Posted by: restlessdesign
Posted on: 2006-03-19 11:27:00

Ok I just tried echoing out the size and I'm getting 0, so it looks like the file isn't being transferred. Any takers? Please!

Re: PHP upload issues (works on one site, not anot

Posted by: norm1037
Posted on: 2006-03-19 11:43:00

Are you using a different MySql database/hostname for each script? The only thing I can think of is that they have not been created yet.
I was going to upload a test image to see if it might be a local browser cache problem, but I did not know if your scripts were live, so I did not. smile

Re: PHP upload issues (works on one site, not anot

Posted by: restlessdesign
Posted on: 2006-03-19 11:48:00

well, even if i comment out any of the mysql code and only try and echo out the tmp_name I get nothing or size and I get 0. in the php documentation, it says:

"If no file is selected for upload in your form, PHP will return $_FILES['userfile']['size'] as 0, and $_FILES['userfile']['tmp_name'] as none."

So I'm completely stumped, because I'm definately selecting a file in my form.

Re: PHP upload issues (works on one site, not anot

Posted by: restlessdesign
Posted on: 2006-03-19 12:07:00

I got an error of "6" which states:

"Value: 6; Missing a temporary folder"

So...how do I create a temporary folder?

Re: PHP upload issues (works on one site, not anot

Posted by: ardco
Posted on: 2006-03-19 16:52:00

> I can see <b>NO DIFFERENCE</b> between the two.

In reply to:

The broken one (hosted on Whittier):
http://michaelmarmora.com/admin/portfolio.php

The working one (hosted on Grant):
http://kevinsweeneydesign.com/mikemarmora/admin/portfolio.php


Obviously there's an "extra" directory level in the 2nd, that's not in the 1st.

So, I wonder if it's a path thing, like:

$imageNew = '../images/' . $_FILES['imageFile']['name'];
$thumbNew = '../thumbs/' . $_FILES['thumbFile']['name'];

points to valid locations in the one, but not in the other?

Good luck,

BobS

Re: PHP upload issues (works on one site, not anot

Posted by: restlessdesign
Posted on: 2006-03-19 16:57:00

resolved.
my temp directory wasn't working because dreamhost didn't change a permission setting when they upgraded something.

Tags: php uploaddreamhostmime typefile pathportfoliohttppermission settingsimage filedatabase namejpegdomainsscriptsdirectoriescgi