#901 closed defect (fixed)
browse should use a better name when uploading an entry from the journal
Reported by: | tomeu | Owned by: | erikos |
---|---|---|---|
Priority: | Urgent | Milestone: | |
Component: | Browse | Version: | 0.84.x |
Severity: | Major | Keywords: | r+ |
Cc: | Distribution/OS: | Unspecified | |
Bug Status: | New |
Description
Report from Tony Forster:
download a file from the net saves in journal as: File inventory.gmd from http://rupert.id.au/schoolgamemaker/samples1/inventory.gmd. attach the file in webmail file attached is titled : tmpTjCrkn.bin full path is: /home/olpc/isolation/1/uid_to_home_dir/10011/tmp/tmpTjCrkn.bin
Attachments (1)
Change History (16)
comment:1 Changed 14 years ago by tomeu
comment:2 Changed 14 years ago by tonyforster
See also ticket 899, preservation of filename on downloading
comment:3 Changed 14 years ago by erikos
- Bug Status changed from Unconfirmed to New
- Milestone changed from Unspecified by Release Team to 0.86
- Severity changed from Unspecified to Major
- Version changed from Unspecified to 0.84.x
Do we have a chance to get this in?
comment:4 Changed 14 years ago by tomeu
- Priority changed from Unspecified by Maintainer to Urgent
comment:5 Changed 14 years ago by alsroot
- Owner changed from tomeu to alsroot
- Status changed from new to assigned
comment:6 Changed 14 years ago by alsroot
I guess the simplest way would be just using title in all cases
and initial value for title could be original filename(with extension).
comment:7 Changed 14 years ago by alsroot
..and while uploading file from ds, sugar can detect(somehow) should it add mime_type extension or use title as is
comment:8 Changed 14 years ago by alsroot
..and while downloading file to ds, sugar can remove mime_type extension
comment:9 Changed 14 years ago by alsroot
- Status changed from assigned to accepted
comment:10 Changed 14 years ago by alsroot
- Component changed from journal to Browse
After discussing this issue on irc,
Looks like coding this feature in shell could bring undesirable issues(e.g. in case of creating tmp directory instead of tmp file cou, developper should remove directory and it breaks existed API).
At least for 0.86 this feature could be implemented only in Browse.
comment:11 Changed 14 years ago by alsroot
As was mentioned above, one of issues is extension.
So, it could be:
- (already implemented) while downloading to Journal, keep full name(w/ extension) as a 'title'
- while uploading from Journal try to guess
The major point of guessing
- instead of just using 'title' as is, jobject could be generated by sugar(so, w/o any extensions)
- instead of using mime_type extension, original(downloaded) file can have different extension e.g. .conf and not .txt)
Guessing could be
- if 'title' ends by mime_type extension, leave it as is
- if 'title' doesn't end by '\.\S$', add mime_type extension
comment:12 Changed 14 years ago by alsroot
- Keywords r? added
- Owner changed from alsroot to erikos
- Status changed from accepted to assigned
Changed 14 years ago by alsroot
comment:13 Changed 14 years ago by erikos
- Keywords r+ added; r? removed
comment:14 Changed 14 years ago by erikos
- Resolution set to fixed
- Status changed from assigned to closed
|TestCase| - upload a journal entry using browse - check that the file name is constructed of the entry title
We may be able to split it in separate issues:
I think this ticket could be dealt solely from the Browse activity, but depending on the solution we may be able to implement it in the datastore and benefit other use cases.