-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing file url #29
Comments
Happy New Year to you too :-) Are you trying to access the URL so that you can call the file on the client side? If you want to load a stored upload on the client side, then you could use the For example, if you upload a file (the initial temporary upload) and you get an ID back for your uploaded file of There is also a The alternative option would be to add a view into your own app using a URL pattern of your choice and then within the view implementation, use the provided On the server side, you should be able to create the path to the stored file by joining the value of Hope that helps and answers the question. |
Yes I am using load and restore endpoints on my client when using Filepond javascript interface. But there's a case when I need to display uploaded pictures on the website with related posts. I need an actual web url, which I can insert into html, not a server path. Usually I use This is what I'm talking about: https://docs.djangoproject.com/en/3.0/ref/models/fields/#django.db.models.fields.files.FieldFile.url Hope that makes more sense. |
I've solved my predicament this way: #30 If you don't see any issues with this, you can merge it :) |
Many thanks and apologies for not responding sooner to your previous response. Your fix looks good. While this doesn't seem to introduce breaking changes from the API perspective, the DB update means that I think there should be a major release to include this change. I'm planning a 0.4.0 release with a few other fixes and this will be included in that. |
I'm back :) Happy New Year!
I'm almost finished with integrating this library into my project.
One last thing which I'm confused about is how do I access the url of the
StoredUpload
.I can see that
TemporaryUpload
has afile = models.FileField
, butStoredUpload
has onlyfile_path = models.CharField
. This means I can't accessobj.file_path.url
.Am I missing something? Or is this a bug?
Cheers
The text was updated successfully, but these errors were encountered: