Fix Photo Uploader

I am a PHP developer but am having trouble getting my multiple image upload script to work on my website. The problem is the processing code.

Please see http://www.potspace.co/upload_photos.php

The JSON response shows success, even the file name is stored in the database, however no files are seen in the filesystem. I’ve tried for hours to ensure the file paths are valid without success.

I’ve tried to view the server error logs but nothing is being logged that shows why the filenames are showing up in the database but the files themselves aren’t showing up in the server. The permissions are 777 for the directories.

I’ve tried using $_SERVER[‘DOCUMENT_ROOT’].”/user_images/thumbs/” and I’ve tried to just use “/user_images/thumbs/” or “../../user_images/thumbs/”, none of which have worked. I think the problem may be elsewhere.

I am attaching the file that I have that will process the files. Maybe the best thing will be to start from scratch as I once duplicated the function three times with slight modifications in order to produce the three separate images. That was on my old website and now I am using this code in a different fashion which is probably why it’s not working.

What should happen is any .jpg, .jpeg, .gif, .png up to 10mb is accepted and should have three thumbnails created from that file before being destroyed. There shouldn’t be any issues with uploading transparent images. The three new maximum resolutions should be 800×600, 150×150, 50×50 and the original destroyed. The file name should be stored in the database for the userid of the person who uploaded. This shouldn’t take anyone (other than me) very long.

Thanks in advance for helping!

Leave a Reply

Your email address will not be published. Required fields are marked *