Closed Bug 426177 Opened 16 years ago Closed 1 year ago

Should give error message when file upload fails due to insufficient permissions

Categories

(Firefox :: File Handling, defect)

3.5 Branch
x86
Windows Server 2003
defect

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: david.balazic, Assigned: sergesanspaille)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13

When uploading a file in a HTML form, if the file is not readable due to permission, the upload silently fails.

Reproducible: Always

Steps to Reproduce:
1. open any HMTL form that has a file upload feature, eg. http://load.imageshack.us/
2. browse and select a file that has no read permissions
3. submit the form
Actual Results:  
Upload silently fails. Exact result depends on web site. imageshack just reloads the upload form, without giving any hint why the upload failed.
Other sites proceed, but behave as if an empty file were uploaded.

Expected Results:  
Firefox fails with a message like: Can not upload file foo due to missing read permission.
Reporter, are you still seeing this issue with Firefox 3.6.x or later in safe mode? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles
Whiteboard: [CLOSEME 2010-07-30]
Version: unspecified → 2.0 Branch
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100504 Firefox/3.5.10 ( .NET CLR 3.5.30729)

imageshack still behaves as reported before.

I'll try an upload of no-read-permission file here in bugzilla (as attachment to bug report).

The result:
the web page reports an error:

The file you are trying to attach is empty, does not exist, or you don't have permission to read it. 


I also tested with IE8:

for imageshack it pops up a dialog:

---------------------------
Message from webpage
---------------------------
No files uploaded
---------------------------
OK   
---------------------------


For bugzilla:

same as FF (see above).
So, if you try to upload a file that you don't have read permisions on,it fails? That would be the normal behavior.
Component: General → File Handling
QA Contact: general → file.handling
Whiteboard: [CLOSEME 2010-07-30]
Version: 2.0 Branch → 3.5 Branch
No, normal behavior is a message like "Error, no permission to read file" or "Access is denied.", not silent failure.
Summary: File upload silently fails → Should give error message when file upload fails due to insufficient permissions
Please reopen the bug if anyone can still reproduce the issue.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → WORKSFORME
Firefox 23.0 on Windows 7 64 bit, the page http://load.imageshack.us/, when selecting a file with no read permissions, upon clicking the "Open" button in the file open dialog, I get a dialog:

[Window Title]
File Upload

[Content]
test.jpg
You don’t have permission to open this file. 

 Contact the file owner or an administrator to obtain permission.

[OK]

Same if I try to attach such a file to this bug report.


FF 23.0 on Windows XP SP3 behaves differently:
both on imageshack and bugzilla, the file can be selected and then clicking on the Submit button makes nothing. As if ignored. (it is not disable, when clicked it visually depresses)
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Hello,

I've got a similar (if not the same) issue with uploading a file that I have insufficient permissions. I'm using Firefox 23.0 (on Ubuntu 12.04.3 LTS, 32bit), and I'm unable to attach a read-protected (chown 000) file to this issue here. However, my initial problem (which has lead me to this bug report) is that firefox 23.0 is unable to upload a file via a form if the form's target is set to another iframe. For example you can check following jsfiddle to experience the wrong behavior: http://jsfiddle.net/ucTGE/2/

It contains a simple form with iframe:

<form enctype="multipart/form-data" action="" method="post" target="test">
    <p>Browse for a file to upload: </p>
    <input type="file" name="uploaded_file"/>
    <br /><br />
    <input type="submit" value="Upload It Now" />
</form>
<iframe name="test" height="100"></iframe>

When I try to upload a chmod=000 file via that form, I'm seeing in the firebug that FF is trying to send something (it initiates some POST request), but it never finishes. In the firebug I see that the POST request spinning wheel is spinning endlessly.

On the other hand if I upload a file that I have proper permissions (chmod 644), then the POST request occurs immediately and I see in the iframe the page result after upload. In the case of insufficient permissions the iframe stays white (unrefreshed).

regards,
I can't reproduce this with FF24 on Win7, As with comment 6, I get a not allowed error when I try to select the file.  HOWEVER, using FF24 on WinXP Pro SP3, I am allowed to select the file but when I click on Bugzilla's submit button to upload the attachment, the button does nothing and I am not given any sort of error message.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Still can reproduce this with Firefox 58.0b10 (64-bit) on openSUSE Tumbleweed 20171206.

Steps to reproduce:

1. Create text file on local filesystem.
2. Set permissions to 0600.
3. Attempt to upload file to test website[1].

[1]: http://www.csm-testcenter.org/test?do=show&subdo=common&test=file_upload

Actual result:

408 Request Timeout from website after 10+ seconds.

Expected result:

Immediate error from browser that file cannot be accessed.
Problem still persists (Firefox 60.0.1) (64-bit) Linux.

And is pretty annoying, since Firefox even fires an invalid request
(tells the server, that filesize bytes are coming, but only sends well nothing :) ).

Which in most cases (see above) will lead to a request timeout.

See also my bug report in OpenWrt (LuCi):

https://github.com/openwrt/luci/issues/1849

Long story short:

* It is a firefox bug, since firefox sends invalid requests to the server.
* It's still present within current version
* It should be fixed within firefox, because the server timeout is the correct response (firefox announces data to come, but doesn't close the connection, so what should we do on server side?)

So it might be a nice idea to fix the bug on it's 10th anniversary...
This has happened to me with Firefox 62.0.3. I wanted to upload an attachment to bugzilla to which the user didn't have permissions and bugzilla reported:

Software error:
Malformed multipart POST: data truncated
For help, please send mail to the webmaster (webmaster@g.o), giving this error message and the time and date of the error.

This has happened to me with Firefox 78.9.0esr (64-bit) installed using Portage on Gentoo Linux. Our in-house forms routing system returns a blank page with status 400 (which I have reported up the chain).

Related and much older (21 years): bug #47009

Severity: normal → S3

Gentoo's been getting at least two reports a month from users hitting this problem and being confused by the resulting error — and that's after we've started warning about it above the Bugzilla file attaching box. I've now even added a big informative section to our 500 error pointing to this bug.

Assignee: nobody → sguelton
Pushed by sguelton@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/494db8fc4415
Alert user when selecting unreadable input file r=emilio
Status: NEW → RESOLVED
Closed: 11 years ago1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
Depends on: 1814847
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: