Not Checking Max Size Before Form Submission
Posted: 06 October 2010 01:04 AM   [ Ignore ]
Wallflower
Rank
Total Posts:  17
Joined  2010-08-24

I have a SafeCracker File field in a SafeCracker form that allows users to upload photos. The directory to which these photos are uploaded has a max file size of 3 KB and max dimensions of 500px x 500px.

If too large a photo is chosen in the form, the entry will go through without uploading the photo or giving any error message to the user.

The built-in file field won’t work because I can’t control to which directory the photos are uploaded and there’s no way users are going to always upload to the right place, esp. if their photo is too large, they may just upload it to a different dir that allows for larger photos. Plus it’s just not as simple and familiar for users as the SafeCracker File field.

Profile
 
 
Posted: 06 October 2010 02:12 AM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I just got another bug report of this variety, I’ll have to look into why the error message isn’t displaying.

Profile
 
 
Posted: 06 October 2010 09:26 PM   [ Ignore ]   [ # 2 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Can you download the latest build of SafeCracker if you haven’t already, and see if it gives you an error message now.

Profile
 
 
Posted: 06 October 2010 09:46 PM   [ Ignore ]   [ # 3 ]
Wallflower
Rank
Total Posts:  17
Joined  2010-08-24

Thanks for the quick turnaround!

It gave an error when the SafeCracker file field was independent, but not within a Matrix.

I used two rows in the Matrix:
Row 1 had a file too large and a caption, and
Row 2 had a file within limits and a caption.

Row 2’s data went through and displays properly, but Row 1 just ignored the SafeCracker File field (it’s null now) and saved the caption.

I’m also hoping that all errors will be displayed on the error page (not sure now since the Matrix one isn’t giving me the error).

And I doubt this is a SafeCracker thing… when I went back after the error message the Matrix data had been cleared.

Thanks for your help.

Profile
 
 
Posted: 06 October 2010 09:47 PM   [ Ignore ]   [ # 4 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

If you do this in the control panel, do you get any error messages?

Profile
 
 
Posted: 06 October 2010 10:06 PM   [ Ignore ]   [ # 5 ]
Wallflower
Rank
Total Posts:  17
Joined  2010-08-24

I get the error for the independent SafeCracker file, not for the one in the Matrix.

In the CP, it does save the two rows and the captions, but not the SafeCracker Files.

Profile
 
 
Posted: 08 October 2010 07:57 PM   [ Ignore ]   [ # 6 ]
Wallflower
Rank
Total Posts:  17
Joined  2010-08-24

Will errors in Matrix be supported?

Profile
 
 
Posted: 08 October 2010 07:58 PM   [ Ignore ]   [ # 7 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I’m not sure Matrix has a facility to display errors. I’ll have to look into that.

Profile
 
 
Posted: 08 October 2010 07:59 PM   [ Ignore ]   [ # 8 ]
Wallflower
Rank
Total Posts:  17
Joined  2010-08-24

Ahhh, gotcha. Thanks.

Profile
 
 
Posted: 08 October 2010 08:00 PM   [ Ignore ]   [ # 9 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

I’m trying to think of one, but I don’t believe I’ve ever seen an error message for a cell.

Profile
 
 
Posted: 27 October 2010 02:10 AM   [ Ignore ]   [ # 10 ]
Wallflower
Rank
Total Posts:  17
Joined  2010-08-24

Brandon says it’s on his list to add this functionality.

Profile