-
Notifications
You must be signed in to change notification settings - Fork 4
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
Using Ajax with demo #1
Comments
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. |
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 |
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? |
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. |
Hi, I am confused as to where the django-ajax-uploader is being used in this demo. When I add an image to the demo, the post request isn't sent through ajax, right? Because the url changes after the save button is clicked, which means the form isnt using ajax, right?
The text was updated successfully, but these errors were encountered: