[ckan-dev] Ckanext-storage configuration issue
Rufus Pollock
rufus.pollock at okfn.org
Tue Jun 7 15:35:19 UTC 2011
On 7 June 2011 16:21, <p.romain at cg33.fr> wrote:
[...]
> The first time I load the url datalocale.cg33.fr/storage/upload the directory storage got created
> The upload worked fine and I included the link to my package description. However when the user clicks on the link provided it does not provide the format which can be a bit challenging for an average user
> file_f783822f-2719-4c0b-87fc-f7d0eb4ce73e is a bit cryptic .
>
> Is there a way to modifiy this ?
I agree this is annoying and something I wanted to fix. Some obvious ideas:
0. Compute mimetype on file upload and set this on download
Note this is done automatically by remote backends like Google storage
and S3. Wouldn't be impossible to do.
1. Include the original filename in the filepath.
Problem: for remote backends (google storage etc) we don't know this
file when we submit file for upload from upload form and hence cannot
find out where the file exactly was uploaded to (so we can't do things
like put a nice url for it when you return to CKAN or create a
resource -- or do anything post upload!)
2. Allow users to specific a filename for upload
Problem: for remote backends this requires that we regenerate the
authentication policy which requires some javascript to regenerate the
upload form policy doc each time users edits a field (not impossible
given that we do have the auth form api ...). Does have advantage you
could allow other fields (e.g. mimetype to be added).
Other key improvements (that sort of relate):
* Automatically create a CKAN resource for the uploaded file (and
allow association to a package)
* Allow users to overwrite their own files (which would require us to
stop auto-generating filepaths)
Rufus
More information about the ckan-dev
mailing list