Closed Bug 259903 Opened 20 years ago Closed 19 years ago

save as plain text saves the file with the wrong extention (.html instead of .txt)

Categories

(Camino Graveyard :: Downloading, defect, P2)

PowerPC
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.0

People

(Reporter: david.fedoruk, Assigned: nick.kreeger)

References

()

Details

(Keywords: fixed1.8)

Attachments

(3 files, 2 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8a4) Gecko/20040915 Camino/0.8+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8a4) Gecko/20040915 Camino/0.8+

When saving a web page as plain text the dialogue box is selected as plain text
but the file name is still file.html and the resulting file is the comlete html
code.

Reproducible: Always
Steps to Reproduce:
1. File --> Save As
2. Select plain text (this is already selected)
3. click Save

Actual Results:  
The selected file is saved as an html document not plain text.

Expected Results:  
The page should have been saved as a plain text documenting with NO html tags.
does this work in 0.8.1? was it a regression on the trunk?
Attached file File Save As example
Since there seems to be some puzzlement about what is being saved, this is an
example saved from this buiild 2004091808 (v0.8+) URL:
http://www.saila.com/usage/layouts/
It seems this is done on purpose
<http://bugzilla.mozilla.org/show_bug.cgi?id=16800>. However a problem still
persists in that Camino AND Mozillz save text documents with the wrong
extension. Camino saves this text document with an html extension where it
should be .txt
Is it just me, or does the whole save as plain text seem stupid as it will
always be the same as "save as source" as both files will be plain text. Only
difference will be the extension. Perhaps removing "save as plain text"?
I've now changed the bug to a problem with correct file extension.
Summary: attempting to save a page as plain text, saves as html → save as plain text saves the file with the wrong extention (.html instead of .txt)
Confriming and handing over to Josh.
Assignee: pinkerton → joshmoz
Let's confirm the shall we :)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P2
Target Milestone: --- → Camino1.0
(In reply to comment #8)
> Is this related to bug 181029?

Sounds like it is, yeah. It could also be an encoding problem, similar to our
treatment of gzip files on some (improperly configured) servers.
Problem occurs in Deer Park Alpha 2, so it is a gecko/necko issue
Well, we copied some of their downloading code. I think we choose our own file
extension in the download sniffer code.
inspecting smfrs comments......
Taking. Problem is that we are saving correctly, and the sniffer correctly
assigns the content to plain/text, but the .html extension is not getting
changed to .txt when the "plain text" option is saved.. 
OK, Have a working solution, to append .txt to the file name, but a question
about what to do here. 

// Assume the file is called index.html

Should we just rename the file to index.txt OR should we add the extension
index.html.txt???

I vote for option 2 as you can keep track of what plain text you were trying to
save.

Any other ideas, suggestions???
Assignee: joshmoz → nick.kreeger
I agree with option 2 as it will allow people to know what they were saving.

Perhaps changing the extension to index.html.txt in the text field on the save
dialog?
When we save pages (like Bugzilla bug) as HTML Complete, they get saved as
foo.cgi.html, so foo.cgi.txt seems appropriate here, too.  

That new name is suggested in the Save dialogue for HTML Complete, so Plain Text
should also suggest the name it's going to use.

(Seems like right now the logic for all three "Save as" variations is the same.)
This patch will append .txt to a file name if the option to save is "plain
text". The filename in the save dialog cannont be manually changed since the
dialog is run with one command with a return value. The best way I could find
to fix a simple problem like this is to simply append a .txt to the filename
after the dialog closes and the user selected "plain text".
Attachment #191696 - Flags: review?(pinkerton)
Attachment #191696 - Flags: review?(pinkerton) → review?(sfraser_bugs)
working on actually updating changes with a hack in a NSSavePanel accessory..
Attachment #191696 - Attachment is obsolete: true
Comment on attachment 191696 [details] [diff] [review]
This patch appends .txt if the save option is plain text

Reworking patch so removing review, sorry for the spam
Attachment #191696 - Flags: review?(sfraser_bugs)
Looks good! Tested and checked in, trunk and branch.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Keywords: fixed1.8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: