Comments (4)
The django-ajax-uploader is used to upload an image by Ajax to the server and get the temporary path of that image. As you see, the upload happens immediately, when you select an image from your filesystem, NOT when you click on the submit button.
The form itself in this example doesn't use Ajax. It just submits the temporary image path and then the image is copied from the temporary upload path to its final destination. If you need Ajaxified version of the form with the hidden field too, it is not too difficult to modify the view and add some Ajax handling javascript for the form.
from imageuploads.
Ahh okay that makes sense, so when the user adds a image from their filesystem, the image is immediately sent to the server, which is the ajax part, thanks for clearing that up
from imageuploads.
One more question: How does the system know what to do when a user selects a picture, but then doesnt actually do a post request? The image should then be deleted from the filesystem, since the user for example, clicked the back button, right?
from imageuploads.
This app example doesn't cover that, but there could be a management command run by a cron job which deletes all temporary files in the directory which are older than (let's say) a day.
from imageuploads.
Related Issues (1)
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 imageuploads.