Opened 15 years ago

Closed 15 years ago

Last modified 11 years ago

#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)

sugar-901.patch (3.8 KB) - added by alsroot 15 years ago.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 15 years ago by tomeu

We may be able to split it in separate issues:

  • The extension should be stored and preserved. Possible problem: what if the user opens the entry with some activity that changes the format in which the file is saved?
  • The base file name should be stored and preserved. Possible problem: what should we do if the user changes the title? Should we discard the old filename and generate a new one from the entry title?

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.

comment:2 Changed 15 years ago by tonyforster

See also ticket 899, preservation of filename on downloading

comment:3 Changed 15 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 15 years ago by tomeu

  • Priority changed from Unspecified by Maintainer to Urgent

comment:5 Changed 15 years ago by alsroot

  • Owner changed from tomeu to alsroot
  • Status changed from new to assigned

comment:6 Changed 15 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 15 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 15 years ago by alsroot

..and while downloading file to ds, sugar can remove mime_type extension

comment:9 Changed 15 years ago by alsroot

  • Status changed from assigned to accepted

comment:10 Changed 15 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 15 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 15 years ago by alsroot

  • Keywords r? added
  • Owner changed from alsroot to erikos
  • Status changed from accepted to assigned

Changed 15 years ago by alsroot

comment:14 Changed 15 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

comment:15 Changed 11 years ago by dnarvaez

  • Milestone 0.86 deleted

Milestone 0.86 deleted

Note: See TracTickets for help on using tickets.