From issues-return-17475-archive-asf-public=cust-asf.ponee.io@airavata.apache.org Wed Apr 22 16:17:04 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 3FEB4180181 for ; Wed, 22 Apr 2020 18:17:04 +0200 (CEST) Received: (qmail 75483 invoked by uid 500); 22 Apr 2020 16:17:03 -0000 Mailing-List: contact issues-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@airavata.apache.org Received: (qmail 75471 invoked by uid 99); 22 Apr 2020 16:17:03 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Apr 2020 16:17:03 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id DF635E3161 for ; Wed, 22 Apr 2020 16:17:02 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id A99CA780BE7 for ; Wed, 22 Apr 2020 16:17:00 +0000 (UTC) Date: Wed, 22 Apr 2020 16:17:00 +0000 (UTC) From: "ASF subversion and git services (Jira)" To: issues@airavata.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AIRAVATA-3281) Capture and use mime-type for input and output files MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/AIRAVATA-3281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17089830#comment-17089830 ] ASF subversion and git services commented on AIRAVATA-3281: ----------------------------------------------------------- Commit 9800b7a75d4132fbc84a074a0b1e9e0e95ddcbfb in airavata-django-portal's branch refs/heads/master from Marcus Christie [ https://gitbox.apache.org/repos/asf?p=airavata-django-portal.git;h=9800b7a ] AIRAVATA-3281 Capture content type of uploaded file > Capture and use mime-type for input and output files > ---------------------------------------------------- > > Key: AIRAVATA-3281 > URL: https://issues.apache.org/jira/browse/AIRAVATA-3281 > Project: Airavata > Issue Type: Bug > Components: Django Portal > Reporter: Marcus Christie > Assignee: Marcus Christie > Priority: Major > > h2. Proposal > - store {{mime-type}} in {{DataProduct.productMetadata}} > - For input files, {{mime-type}} value is whatever is present in the upload request. > - For output files, {{mime-type}} value comes from {{OutputDataObjectType.metaData['file-metadata']}}. When output data staging register the DataProduct, it will need to read the OutputDataObjectType.metaData and copy the file-metadata to the DataProduct's productMetadata > -- Application output can be configured with the metadata like the following: > {code} > { > "file-metadata": { > "mime-type": "text/plain" > } > } > {code} > - in Django portal, when downloading data product, if metadata has {{mime-type}} then use that as the content type. Otherwise, set the content type to {{application/octet-stream}} and add a {{Content-Disposition}} header with value {{attachment; filename=...}} (which is what is currently happening all the time). > h3. Other details > - Django portal should retain DataProduct metadata when moving or copying input files > - The DataProduct download URL will accept a {{download}} query param to force download even when there is a mime-type in metadata > - image outputs can be displayed inline > - if there is no mime-type for a file, try to guess based on file extension (using [mimetypes|https://docs.python.org/3/library/mimetypes.html] Python module) > h3. TODO > - [x] Capture mime-type when files are uploaded > -- input files > -- data store files, XHR upload > -- data store files, tus upload > - [x] copy metadata when input files are moved/copied in storage > - [x] images can be displayed inline > - [x] In backend, copy mime-type to {{DataProduct.productMetadata}} when registering output file > - [x] fallback on guessing mime-type based on file extension > - [x] only allow viewing/previewing files with known mime-type > - [x] when browser says file is application/octet-stream, check if it is text by trying to read it as unicode (https://stackoverflow.com/a/30273352) and if so set to text/plain > - [ ] add an button to download the file? > h3. Testing > - (/) mime-type is copied for input files when experiment is cloned > - (/) mime-type is added to DataProduct for output files by the OutputDataStagingTask when it is provided in OutputDataObjectType.metaData > - image outputs are displayed inline in Experiment Summary (requires an application that generates image outputs) -- This message was sent by Atlassian Jira (v8.3.4#803005)