Closed
Bug 281343
Opened 20 years ago
Closed 20 years ago
Cannot save web pages using very long filenames
Categories
(Core Graveyard :: File Handling, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: son.le0, Assigned: son.le0)
Details
Attachments
(1 file, 2 obsolete files)
5.37 KB,
patch
|
son.le0
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041109 Firefox/1.0 (MOOX M1)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041109 Firefox/1.0 (MOOX M1)
Follow on from bug 241864, comment #16
On Windows, the MAX_PATH for a filepath (drive letter + directory name + file
name) cannot be longer than 248 chars. nsWebBrowserPersist (and possibly other
places) fails to check against this limit and fails silently.
Reproducible: Always
Steps to Reproduce:
1. Open any webpage
2. Select Save Page As...
3. Enter the following filename
1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678912345678
4. Click on save
Actual Results:
Nothing.
Expected Results:
Page saved or error message indicating save has failed.
Don't know which area this bug belongs, there was no embedding/components
selection. :)
Anyway, the problem is here:
http://lxr.mozilla.org/mozilla/source/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp#1586
Possible solutions are to truncate the filepath or fail and show an error message.
Version: unspecified → Trunk
Bug 129911 is also related...
Christian, can you please have a look at this bug and patch for me?
Comment 5•20 years ago
|
||
Comment on attachment 174127 [details] [diff] [review]
proposed patch v0
you can not hardcode english messages.
Also, I am not sure that an unparented prompt is really a good thing.
Can't you just call SendErrorStatusChange, with an appropriate error code
(possibly a new one)?
Attachment #174127 -
Flags: review-
Updated•20 years ago
|
Assignee: general → file-handling
Component: General → File Handling
Product: Mozilla Application Suite → Core
QA Contact: general → ian
Use SendErrorStatusChange() instead, which works much better. Had to alter
nsLocalFileWin.cpp which is in xpcom (and added a missing break or two as
well).
Not sure about the wording of the error messages. Does it need to be run by
anyone first? Translators?
Attachment #174127 -
Attachment is obsolete: true
Attachment #174369 -
Flags: review?(cbiesinger)
Comment 7•20 years ago
|
||
Comment on attachment 174369 [details] [diff] [review]
proposed patch v1
looks great to me, thanks!
I'm not sure that the text for the AlreadyExistsError is so good, since users
may not even know about a _files directory... I guess it's a rare case, so it
probably won't matter much.
r=biesi. please get review from darin or dougt for the xpcom change.
Attachment #174369 -
Flags: review?(cbiesinger) → review+
Comment on attachment 174369 [details] [diff] [review]
proposed patch v1
dougt, asking for sr for xpcom change.
:bi, originally just had "file already exists" but found it was a bit
misleading as users might go looking for the wrong file. Thought the _files
might give them a hint.
Attachment #174369 -
Flags: superreview?(dougt)
updated to match with new nsWebBrowserPersist.properties location
Attachment #174369 -
Attachment is obsolete: true
Attachment #175682 -
Flags: superreview?(dougt)
Attachment #175682 -
Flags: review+
Assignee | ||
Comment 10•20 years ago
|
||
carried forward cbiesinger review+
Attachment #174369 -
Flags: superreview?(dougt)
Updated•20 years ago
|
Attachment #175682 -
Flags: superreview?(dougt) → superreview+
Assignee | ||
Comment 11•20 years ago
|
||
:bi, can you please check this in for me?
thanx in advance.
Comment 12•20 years ago
|
||
checked in for 1.8b2, thanks for the patch!
Checking in dom/locales/en-US/chrome/nsWebBrowserPersist.properties;
/cvsroot/mozilla/dom/locales/en-US/chrome/nsWebBrowserPersist.properties,v <--
nsWebBrowserPersist.propertiesnew revision: 1.2; previous revision: 1.1
done
Checking in embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp;
/cvsroot/mozilla/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp,v
<-- nsWebBrowserPersist.cpp
new revision: 1.106; previous revision: 1.105
done
Checking in xpcom/io/nsLocalFileWin.cpp;
/cvsroot/mozilla/xpcom/io/nsLocalFileWin.cpp,v <-- nsLocalFileWin.cpp
new revision: 1.136; previous revision: 1.135
done
Assignee: file-handling → son.le0
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•20 years ago
|
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 13•20 years ago
|
||
+fileAlreadyExistsError=%S could not be saved, because a file already exists
with the same name as the '_files' directory.\n\nTry saving to a different location.
+fileNameTooLongError=%S could not be saved, because the file name was too
long.\n\nTry saving with a shorter file name.
nit: Didn't need the commas before "because".
Updated•8 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•