Show Error Message For Photo Upload

Hi, I would like to show error messages when the user makes a mistake with the photo upload. Right now, if a user tries to upload a file that is too  big or in the wrong format, no message comes up and the photo remains blank. I would like the reason why the photo has not been uploaded to be shown to the user.

 

The code for this seems to be in the uploadMedia() function in inc/classes/BXDolMedia.php but from the understanding the method that is being used is the uploadMedia() in uploadPhoto.php.

 

Please has anyone done this? Can you help, I think it would be a very useful one for the community.

 

Thanks

Quote · 7 Jul 2009

Hi, i ask the some question and i have one answert (the post is : http://www.boonex.com/unity/forums/#topic/Image-size-2009-07-03.htm).

I resolve the problem of the uploading changing some value to the .htaccess following this tutorial :

http://www.dialme.com/articles/entry/-htaccess-php-ini-Help-Guide#htaccess

I don't have any solution for show an error message... sorry... i still look around...

I hope you can resolve the problem.. (my was the max time upload, was 30 sec. and now is 1000..)

P.s. after i make the change, when i check the phpinfo i didn't see ant changes... but when i upload an image of 4Mb work fine..)

...
Quote · 7 Jul 2009

Ok, other users have the problem as well. Can anyone help, because right now there is no feedback to the user when they try to upload a photo and something is wrong.

Quote · 7 Jul 2009

Just trying to keep everyone updated, I got this response from Okweb

 

*************

 

Hi
Not sure about how you can do that,
maybe you can show a status/info message on the Photo/Video/Music Upload Agreement page before your member upload something!!!
You can add html/text to the language streng Media upload Agreement about the file size and limit etc.

Like my ex. below:

Key: _Media upload Agreement


String:

<div align="center">
<table border="2" bgcolor="#EEEEEE" width="39%" cellpadding="2" cellspacing="0" bordercolor="#cc0000" style="border-collapse: collapse" id="table1">
<tbody>
<tr>
<td>
<p align="center"><b><span style="color: #cc0000;">
Photo: MAX size 1024x1024<br />
Music: MAX file size 8 MB<br />
Video: MAX file size 8 MB
</span></b></p>
</td>
</tr>
</tbody>
</table>
</div>
<br /><br />
{0} Upload Agreement


Maybe you can use it...
will show a box on Photo/Video and Music Upload Agreement page.

***************

 

Where is the Photo/Video and Music Upload Agreement page?

Quote · 7 Jul 2009
Another response, Has ANYONE tried to do this???
******************************************************
Hi again
I assumed you had problems to upload an image to gallery,
you have "Photo/Video and Music Upload Agreement" page there.

On profile photo's you don't have it.
Uploaded a photo to my profile with size 3264x2448, no problems.
Was resized to 340x340, this is my settings in Advanced Setting also.

What have you on this settings:
Max width of profile photo (in pixels)
Max height of profile photo (in pixels)

Wich Dolphin Vers. do you use?
and have you tried to switch this settings off, Use GD library for image processing

Ottar
Quote · 7 Jul 2009

Yes, several hosts (rare hosts) give us just blank page instead page with error (no enough memory to convert).

So in these cases will need to check image size before resizing.

So we can locate place where picture uploaded, and before resizes - just call 'getimagesize' function to determinate all necessary info about image. And, if this image is big (that can cause blank page at your host) - better to show warning message instead trying to resize.

cheers )

Quote · 8 Jul 2009
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.