2

In a Django application, during registration, I want the user to be able to see the profile image he/she selects, rather than just see a path as done purely using django forms (for an example of what I want see pinterests registration form). I assume it should involve some ajax upload and it should be stored somewhere temporarily since the user might choose not to proceed with the registration even if the profile image has been uploaded, in which case the uploaded picture should be deleted.

I was wondering what is the best way of handeling this? Any examples out there you can point to?

Thanks!!!

ip.
  • 3,306
  • 6
  • 32
  • 42

2 Answers2

0

You are correct that an AJAX upload will be needed.

Whether the upload is temporary or permanent, things will not change much in your implementation much. In both cases you will need to upload the image to a directory on your web server. In the temporary case, you may delete it after a short amount of time passes.

Here is a Django AJAX uploader: https://github.com/GoodCloud/django-ajax-uploader

Krystian Cybulski
  • 10,789
  • 12
  • 67
  • 98
0

Option 1

You can use the HTML5 FileAPI to show a thumbnail of a user-selected image before they upload it.

Option 2

You can upload the file using AJAX and then send back a thumbnail for them to preview

Enrico
  • 10,377
  • 8
  • 44
  • 55