Comments (4)
Sorry I somehow missed this message.
S3DIRECT_UNIQUE_RENAME
was an old option which was removed at some point. It no longer does anything.
If you want to have unique names you can define a method in settings like this. You then add that method as the first argument of the destination
Yes, you would need to define the saving part yourself unless you are using the Django admin.
from django-s3direct.
S3DIRECT_UNIQUE_RENAME was an old option which was removed at some point. It no longer >>does anything.
Yes, I got that now - I checked everything and nothing changed - so, I guessed it does nothing.
If you want to have unique names you can define a method in settings like this. You then add that >>method as the first argument of the destination
Actually, I have done this. Then what I did was went to s3direct/views.py and just added print filename
like so:
@require_POST
def get_upload_params(request):
content_type = request.POST['type']
filename = request.POST['name']
print filename
< write to cat_cat DB model here..thats easy>
However, what I see is the original filename always - Is there a way I can get both the original filename
and the unique filename
(created with uuid as you have shown in def create_filename
.)? That would be nice because at the moment all I can seem to get is the original filename within django - and not the unique uuid filename (useful to mapping what is on the S3 server).
p.s: I think there is also a minor cross browser bug
in the cat example. So, on firefox, if you upload the file and then refresh(F5) the page, I can still see the REMOVE FILE
tag. On Chrome it is fine.
from django-s3direct.
So.. is this a real issue? Is is not possible to get both the original filename
and unique filename
on the django side?
from django-s3direct.
S3Direct doesn't doesn't really deal with any kind of database storage. All it does is upload something to S3 and return that url to the form field you specify.
So in the example:
https://gist.github.com/bradleyg/65852e7d69adacb43574#file-gistfile1-html-L18
It uploads the file and adds the uploaded files URL to the input field with the class name "file-url". You need to decide what's the best way to save that to your database.
Notice there is no action or submit button on the form, that's up to you to implement.
from django-s3direct.
Related Issues (20)
- Is transfer acceleration supported?
- File inputs overlap with labels in multiple fields forms
- media files not accessible after added the AWS_S3_ENDPOINT_URL
- Add a way to mock s3 for development HOT 4
- [Violation] 'DOMNodeInserted' consider using MutationObserver HOT 1
- Closing out, if this is still an issue feel free to reopen.
- FIle upload works in Admin panel but not through ModelForm
- How Could I Attach MetaData to the S3 Object (file) being Uploaded? HOT 1
- File input doesn't show up HOT 4
- presigned url
- document.body doesn't exist yet when calling oberver.observe HOT 2
- x-amz-content-sha256 not in SignedHeaders
- File Widget not showing in admin panel HOT 3
- Admin upload not displaying in Django 3.2 for versions 2+ HOT 3
- s3direct should validate the path of the uploading file matches the server-generated key on server side
- Please allows to paste image from clipboard to file input in Django Admin
- Is there a way to separate the displayed filename and key value?
- Quick Yes/No Question: Does this package require enabling ACLs on the bucket?
- there is no way to know if error when uploading a file
- Still maintained?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-s3direct.