Jump to content

Problem with uploading images


Guest Christine from gecko Gully

Recommended Posts

Guest Christine from gecko Gully

I have a problem which I am 99% sure is not code-related, rather is related to the server settings. But I need to know more information before I go to the web hosting company with the problem.

What is happening is I have a V3.0.18 site loaded under, say, domain www.abc.com. When I go into FCKEditor and try to upload an image, it acts as though it has worked (i.e. no error messages) but the image is not actually uploaded. If I go to Upload Images, I get the error message "Error: You did not browse for an image to upload or the file was too large for the server. The default maximum upload limit is 2MB. ".

Now I know what you will say - your image file is too big, or it is in a format that is not supported. But that is not the case - it is a small jpg.

Also, I have copied the EXACT same code into another domain, say www.def.com/testsite, and have sucessfully uploaded that EXACT same file. Which is why I am thinking it is some sort of setting outside the code itself, like on the server.

I have done some debugging, and I have found that in the program admin/filemanager/upload.php there is a set of variables called

$_FILES['FCKeditor_File']['name']

$_FILES['FCKeditor_File']['tmp_name']

$_FILES['FCKeditor_File']['type']

$_FILES['FCKeditor_File']['size']

In my case, only the first is being set. Which means that the other three are causing the error messages to be displayed.

But I am having trouble finding out where the values for variables are set.

Can anyone help with where these variables are given their values?

Or has anyone else had a similar problem and come up with a solution?

I have also fiddled about with the GD settings, with no luck.

Thanks!

Christine Abela

Gecko Gully

Link to comment
Share on other sites

Guest Christine from gecko Gully

PS - I also loaded a fully working site from another client into this domain name, and that doesn't work here either.

So it's not a code issue, it has something to do with the domain/server. I just have to work out what!

If I can't get it going, I will have to advise the client to use FileZilla or similar to upload their images, which is messy.

Thanks,

Christine.

Link to comment
Share on other sites

Guest Christine from gecko Gully

PS (again!!) - The permission setting on the images/uploads folder is 777.

Christine.

Link to comment
Share on other sites

Guest Christine from gecko Gully

FINALLY!!

I solved it. (God I'm good - grin).

This was a doozy that took me five days to resolve, but I will let you know what the problem was (also, as always, this is a good place for me to find it when it happens again!).

The reason I couldn't find where the $_FILES thing is set is because this is a built-in php function. But it relies on parameters set in the php.ini file to work.

You can find what settings the php.ini file has by looking on the "Server Info" page in CubeCart admin, by the way. This will also tell you where on the server you can find the php.ini file itself, although that can be a little elusive...

The bottom line is that the default setting for a thing called upload_tmp_dir might not work. The default in php.ini is simply to comment out the line that defines that temporary folder. But for some reason, on this particular installation (and on one other I found when I installed another system today), that is not sufficient.

So I had to set the upload_tmp_dir to point to the \tmp folder on the server. The path to the \tmp folder can be tricky to define depending on where it is, but if you have a look at other folders on the server, and see how they are defined in other places in the php.ini file, you will be able to work it out.

On one installation, I couldn't find the php.ini file at all, so I ended up copying one from another installation and putting it in under the www folder.

Anyway, I hope this helps someone!! I'm off for a celebratory glass of something evil, then an early night for a change.

Christine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...