Page MenuHomePhabricator

show the current size limit when a file upload fails
ClosedPublic

Authored by fabe on Dec 22 2014, 3:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 12:39 AM
Unknown Object (File)
Tue, Dec 17, 8:24 AM
Unknown Object (File)
Wed, Dec 11, 4:56 AM
Unknown Object (File)
Mon, Dec 9, 9:10 PM
Unknown Object (File)
Mon, Dec 9, 5:12 PM
Unknown Object (File)
Fri, Dec 6, 11:36 PM
Unknown Object (File)
Tue, Dec 3, 2:19 PM
Unknown Object (File)
Tue, Dec 3, 10:53 AM

Details

Summary

Show the php.ini setting for max upload or alterantively the in phabricator configured one. Fixes T6663

Test Plan

changed php.ini and alternatively phabricator file upload size settings to minimal values and try to upload a larger file

Diff Detail

Repository
rP Phabricator
Branch
fileupload
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 3318
Build 3325: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

fabe retitled this revision from to show the current size limit when a file upload fails.
fabe updated this object.
fabe edited the test plan for this revision. (Show Details)

I'm wondering if we should have a friendly error and an admin error. If you are just an average user, the message is a bit confusing and meaningless (and perhaps the admin is not even known).

Whatever this error message ends up being, it should continue or improve the ratio of users who bug their administrator to fix configuration : bug the upstream with issues. Or in other words, today when a user encounters this error they bother the administrator or go on a "whose the administrator" hunt; I think whatever change we make should retain this property and certainly not increase the amount of people who come to the upstream with questions.

I think the main difference here was to show the user the actual size limit. Otherwise he'd have to guess, maybe compress the pdf/txt whatever and reupload to get the same error.

But it may be a generally good idea to display the configured administrators information (name/email) or maybe even a link to directly create a maniphest task with the exceptions info whenever an exception is shown?

epriestley added a reviewer: epriestley.

I'm hesitant to do admin vs user messages because I worry they weaken the property @btrahan discusses: particularly, if a user gets the "dumb/friendly" message and tells an admin, the admin is less likely to be able to resolve the error unassisted than if they had all the information.

I think adding the size information while retaining the configuration options in the error messages balances concerns well.

On "mail an admin" / "file a task", we haven't seen much demand for that from installs. We have a very old task (T302) about making traces actionable. After Nuance gets built, it might give us easier / more natural / more flexible options.

src/applications/files/exception/PhabricatorFileUploadException.php
6–18

This construction can be a bit misleading, because it's (theoretically, and probably practically) possible to exceed upload_max_filesize even when storage.upload-size-limit is (incorrectly) configured.

If storage.upload-size-limit is set to 100MB, and upload_max_filesize is set to 1MB, and the user tried to upload a 5MB file, the user would previously receive an exception pointing them at upload_max_filesize, which is correct and specific. They will now receive a message pointing them at storage.upload-size-limit, which is less specific and less useful. The setting may really need to be adjusted (it has not been configured correctly if it is set to a higher value than any of the other limits) but it's less useful to send users there, and it's probably not the setting they want to adjust since it tends to represent intent better than other limits.

Overall, I think we can be most clear and specific by providing two separate error messages.

16

For consistency, capitalize "Phabricator".

Maybe "To adjust this limit..." instead of "Consider changing...", although this is super nitpicky.

This revision now requires changes to proceed.Dec 22 2014, 7:47 PM
fabe edited edge metadata.

adjust wording and seperate the two error conditions

I initially didn't get the '-1000' being the phabricator limit exception and wondered why there were two identical error cases ;)
But to differentiate here totally makes sense.
As i'm not a native speaker, feedback about my wording is always appreciated even when it might seem nitpicky.

This revision is now accepted and ready to land.Dec 23 2014, 1:17 PM
This revision was automatically updated to reflect the committed changes.