commit/galaxy-central: kanwei: Force octet-stream MIME only when downloading datasets to prevent Safari from appending MIME extension
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/83e024cee23d/ changeset: 83e024cee23d user: kanwei date: 2011-10-05 04:25:08 summary: Force octet-stream MIME only when downloading datasets to prevent Safari from appending MIME extension affected #: 1 file (-1 bytes) --- a/lib/galaxy/web/controllers/dataset.py Tue Oct 04 15:56:21 2011 -0400 +++ b/lib/galaxy/web/controllers/dataset.py Tue Oct 04 22:25:08 2011 -0400 @@ -218,7 +218,7 @@ outfname = data.name[0:150] outfname = ''.join(c in valid_chars and c or '_' for c in outfname) if (params.do_action == None): - params.do_action = 'zip' # default + params.do_action = 'zip' # default msg = util.restore_text( params.get( 'msg', '' ) ) messagetype = params.get( 'messagetype', 'done' ) if not data: @@ -370,6 +370,7 @@ to_ext = data.extension valid_chars = '.,^_-()[]0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' fname = ''.join(c in valid_chars and c or '_' for c in data.name)[0:150] + trans.response.set_content_type( "application/octet-stream" ) #force octet-stream so Safari doesn't append mime extensions to filename trans.response.headers["Content-Disposition"] = "attachment; filename=Galaxy%s-[%s].%s" % (data.hid, fname, to_ext) return open( data.file_name ) if not os.path.exists( data.file_name ): Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket