|
Autor |
Nachricht |
bigfairmont
|
Titel: Image could not be uploaded
Verfasst am: Di, 27 Jun 2006, 01:20 |
|
|
Bilddatei
I went to upload this pic on my own phpBB forum. I receive the error message "Image could not be uploaded." In checking your faqs, it says that this is a critical error and must be because it's not a picture.
Debug information is:
Line : 135
File : uploadpic.php
I'm thoroughly confused. I looked in the code, and saw that you were using getimagesize to get the image, and the passing the spot 2 of the array, which for most of my images is 2, and your code doesn't have a value for the 2 in the array where you're looking at file type. So I then went and added it just to see if it would give me a quick fix, and nothing.
I'm not sure where I should be looking to fix this. I thought I had done the mod right per your instructions, but obviously since the graphics work here, I didn't! :lol:
Any help would be greatly appreciated.
George
|
|
Nach oben |
|
boris
Beiträge: 11195
|
Titel: (Kein Titel)
Verfasst am: Di, 27 Jun 2006, 17:29 |
|
|
Before I start digging into my code:
- did you install the latest version of UploadPic ?
The latest version (1.3.2) has been running for more than seven months now and not a single bugfix was needed - all problems were install- or config-related !
- is the picture you uploaded here (top of your post) an image that you can NOT upload in your forum ? If so, it's rather a server-problem (not enough memory ?) oder a problem with your settings in the ACP (picture size / filesize set too small ?) than a bug in UploadPic
____________ beehave - home of humbug ... [we can't afford to be neutral]
|
|
Nach oben |
|
bigfairmont
|
Titel: Re: Image could not be uploaded
Verfasst am: Di, 27 Jun 2006, 20:09 |
|
|
UploadPic v1.3.2
Is the one I have, which matches your current version, and just so you know, I'm not denying that it may be install or config related. I've uploaded my config screen shot here. Bilddatei
I receive the error as happening on the file type verification, and have tried it with several JPGs on my system. I even tried reuploading the one that I uploaded here as my example.
I don't think it's a RAM issue on the server, do you think it may be not allowing enough time for the upload? phpinfo shows my memory limit as 32MB at the moment and postmaxsize is 8MB, I would think that would be enough?
When you say settings in the ACP, what would I adjust? This is my first foray into phpBB but I've moded several other open source applications prior to this.
Regards,
George
|
|
Nach oben |
|
boris
Beiträge: 11195
|
Titel: (Kein Titel)
Verfasst am: Di, 27 Jun 2006, 20:50 |
|
|
You could adjust the maximum filesize that is allowed for an upload, but that doesn't seem to be the problem.
The reason why there's no datatype for type "2" is just a matter of PHP-programming: if the type 2, 9, 10, 11 OR 12, it's all JPG, so no error here, that's just the way the switch-statement works !
Also the upload time can not be the problem as the browser would exit the script if the maximum time is exceeded, giving UploadPic no time to display an error.
I had a similar problem when uploading with Internet Explorer once but that has been fixed long ago (IE would return different - and wrong - filetypes even though the files were the same !).
But as you're probably using the same browser here as in your own forum, I'm out of ideas.
What you can do:
place this code
Code: |
echo '*'.$int_type.' - '.$str_datatype.'*'; |
after this code
Code: |
function uploadpic_check_datatype($str_datatype, $int_type)
{ |
in includes/uploadpic_functions.php and check, what it's giving you - there's got to be a datatype, that's not part of anything "normal" as the function will only return "false" if the given datatypes don't match.
____________ beehave - home of humbug ... [we can't afford to be neutral]
|
|
Nach oben |
|
bigfairmont
|
Titel: (Kein Titel)
Verfasst am: Mi, 28 Jun 2006, 00:26 |
|
|
What I receive back is * - jpg* in the pop up window when uploading this same exact image.
I'm unable to get print_r($int_size) to echo back to the screen, as I figured that might be a good way to see what was happening.
I don't know why the getimagesize isn't working. I have tried to echo it back, I've tried to print_r it, and still nothing.
Any suggestions on why it's happening?
Thanks again for the help.
|
|
Nach oben |
|
boris
Beiträge: 11195
|
Titel: (Kein Titel)
Verfasst am: Mi, 28 Jun 2006, 19:45 |
|
|
bigfairmont @ Mi, 28 Jun 2006, 00:26 gab folgendes von sich: |
What I receive back is * - jpg* in the pop up window when uploading this same exact image.
I'm unable to get print_r($int_size) to echo back to the screen |
Well the first part of the echo (after the "*") should be $int_type, which ist part of $int_size ... and that's empty ! (proven by your print_r-try which did not result in an output)
So: your getimagesize is not working - why, you'll probably have to find out with your server admin (install a newer GD-library or a newer PHP-version or else), but it has nothing to do with UploadPic !!
What you can do:
replace this line
Code: |
return $datatypeok; |
with this one
in includes/uploadpic_functions.php, that will fix the error, BUT: that's no guarantee, that UploadPic will work afterwards as needs more functions - if those won't work as well, this fix will not help you. Also, the "fix" will keep UploadPic from preventing your forum from XSS-exploits, so I actually do NOT recommend to use it !
____________ beehave - home of humbug ... [we can't afford to be neutral]
|
|
Nach oben |
|
bigfairmont
|
Titel: (Kein Titel)
Verfasst am: Mi, 28 Jun 2006, 19:55 |
|
|
But getimagesize does actually work when I do it differently. I have a seperate file created that just calls the getimagesize function, and that returns a value such as this:
Using this:
$int_size = getimagesize('./images/401_goofy_melissa_1.jpg');
I get this when I print_r:
Array ( [0] => 318 [1] => 400 [2] => 2 [3] => width="318" height="400" [bits] => 8 [channels] => 3 [mime] => image/jpeg )
I actually tested that before I came here looking to see what was happening. Could it be something in the way my system is set up and that the file is not actually loading? Is there somewhere I can test the uploading images to see if they aren't being placed in a temporary state?
Thanks
|
|
Nach oben |
|
boris
Beiträge: 11195
|
Titel: (Kein Titel)
Verfasst am: Do, 29 Jun 2006, 17:11 |
|
|
Ok, seems like the picture upload doesn't work. You can put a
phpinfo();
in UploadPic so it'll show you all variables (looks like the needed variable $HTTP_POST_FILES is empty) and the figure out what else to use.
You do have the latest version of phpBB, don't you ? Because with that, you should be able to use UploadPic just fine ... maybe otherwise it's a server-restriction that prevents uploading.
____________ beehave - home of humbug ... [we can't afford to be neutral]
|
|
Nach oben |
|
bigfairmont
|
Titel: (Kein Titel)
Verfasst am: Do, 29 Jun 2006, 18:04 |
|
|
::grumbles::
Okay, it really helps if you set your errors on when you're testing stuff.
I found out the issue, it was the fact that my picture directory was set to 766 instead of 777. I couldn't move the pictures to it.
Thanks for your help, and hopefully this will help others in the future with this kind of error.
|
|
Nach oben |
|
|
|
ähnliche Beiträge |
|
Thema
| Autor
| Forum
| Antworten
| Verfasst am
|
|
limit image dimensions |
Morpheus |
mod support |
1 |
Mo, 15 Sep 2008, 10:01 |
|
UploadPic 1.3.7 (Image Resize) |
Morpheus |
mod support |
6 |
Mo, 08 Sep 2008, 13:15 |
|
Image in search results posts |
martinho |
mod support |
8 |
Mi, 17 Okt 2007, 22:18 |
|
Space around uploaded pics |
Kevio |
mod support |
1 |
Mo, 12 Feb 2007, 21:46 |
|
Image-directory doesn't exist. |
kolja |
mod support |
12 |
Mo, 12 Feb 2007, 00:12 |
Schreiben: nein. Antworten: nein. Bearbeiten: nein. Löschen: nein. Umfragen: nein.
|