![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
php image upload problem
i'm building a tgp script, i have a problem with the thumbnails, they come out distorted.
here is the code: PHP Code:
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Choice is an Illusion
Industry Role:
Join Date: Feb 2005
Location: Land of Obama
Posts: 42,635
|
Could be something in the PHP library??
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 | |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
Quote:
what could it be in the PHP library? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
any ideas?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: Feb 2005
Posts: 2,804
|
bump for ya
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Sofa King Band
Join Date: Jul 2002
Location: Outside the box
Posts: 29,903
|
is the directory you're copying to chmod to 777?
Does the form have the proper encode type? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Apr 2004
Location: Very close to that Jack Daniels bottle..
Posts: 6,341
|
You should check out PHP freaks forums, I'm sure guys there will help ya
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
Suggestion: Copy the file with a .phps extension and put it someone where people can click a link to see it. GFY's 'hahahaha' filter makes it really difficult to understand what you're trying to do.
FWIW - Filtering based on filename isn't as reliable as GetImageSize() to determine if a file is really a jpg or not. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | ||
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
Quote:
Quote:
|
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
Quote:
I'm just using the above script, not resizing or anything. just uploading. after upload, I try to look at the image via browser as: http://mydomain.com/myimage.jpg and there it is. distorted. I already emailed my host (revsharehosting.com) about this, but if I could only tell him what he can do to fix this, because if doesn't - I don't and i'm fucked. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
here is the form by the way:
[HTML] <form name="form1" method=hahahahahaha action="" enctype="multipart/form-data"> <input type="file" name="imagefile"> <input type="submit" name="Submit" value="Submit"> </form> [/HTML] |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
Can you post links to the before and after? There definately sounds like some kind of corruption is going on, I'm curious to see what's happening to the image itself.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
the response from the host is that GD is needed for this
what do you guys think about that? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
i think this is something to do with the type of the file (Binary / Ascii)
how do I set those on upload or move ? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
GD isn't required for file uploads, only for times when you want to do things like GetImageSize(). If you're purely shuffling bytes around, you don't need it.
Binary/Ascii only should apply when dealing with FTP transfers. Web-based uploads don't have the same caveats (or at least they shouldn't!), but that's part of the reason why I wanted to see a before image and an after image, so I could see if there was some sort of corruption going on during the upload phase. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
Quote:
here is a "before": (used upload via php) http://footfetishgallery.net/gallery/thumbnails/04.jpg here is an "after": (used FTP) http://footfetishgallery.net/gallery/thumbnails/04b.jpg |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
just added "sleep(20);" before the "copy" command thinking the image might be copied before it has been fully uploaded or something - I got the same result.
maybe i did'nt put it in the right place |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
Quote:
AFAIK, the php page doesn't even run until the entire request has completed, and file uploads are part of the request... so no sleep() would be necessary. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 | |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
Quote:
http://footfetishgallery.net/gallery/temp.html i'm really out of ideas about this |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
Aha, I think I have it.
I did a 'strings' on your 04b.gif file and found the following: -----------------------------7d51181aaf4 Content-Disposition: form-data; name="imagefile"; filename="C:\backup\guitarstuff\project\tgp\xf\1\0 4.jpg" Content-Type: image/pjpeg It would appear that you're saving the entire raw response string, and not purely the image itself. It maybe the way the file gets handled in the code? Here's what I've used in the past: Code:
if(is_uploaded_file($_FILES[img][tmp_name])) { $szarr = getimagesize($_FILES[img][tmp_name]); if($szarr[2]=IMAGETYPE_JPEG) move_uploaded_file($_FILES[img][tmp_name], $file_target); } HTH. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Confirmed User
Join Date: May 2004
Location: SW Palm Bay, Florida
Posts: 1,323
|
Hi,
This might be of help to you, but I am not sure. It's something I use to upload and move a file to a directory on my server and the GD library also makes a thumbnail version of the image and uploads it to the same directory, but adds a prefix the image name. I put it in a .txt for you: http://www.penis-enlargement-product.us/misc/zester.txt
__________________
subarus. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
Quote:
tried the code you posted here and got the same result mate |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
It's a strange bug... the php code is correct, the form element looks right, and the picture is presumably getting to the right place, the problem is that it's getting messed in the upload.
Have you tried uploading it using a different browser? If it works via a new browser, then it's your old one that's breaking... if it's still buggered, then somehow your server is broken. Having that multipart header embedded in the upload stream is very odd indeed. I'm leaning towards a broken server at this point. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 | |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
Quote:
tried it with other browsers same thing any idea how the hell my host can handle this? what to tell him? |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 |
<&(©¿©)&>
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
|
Is your host using recent version of php and apache?
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000 Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager ![]() Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#29 | |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#30 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Location: Nor'easterland
Posts: 1,914
|
Quote:
- Your images are being corrupted on upload. - You've checked, changed, and confirmed that the code used to process uploads is correct and verified by third parties - The image itself is being corrupted in the upload process. The uploaded image contains part of the headers from the submission, plus extra crap that doesn't belong. Show them the before and after, and point out that the uploaded image ends up LARGER than the original image. - Make sure they know you've tried uploading with different browser types, removing a broken browser as being the reason for the failure - Try uploading other images to see if it happens regardless of the source, which will remove the possibility of a broken graphic as the cause - By the process of elimination (not browser, not code, not image) the only other option would be the way the server handles it. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |