Is there a way to supply the uploader a existing file from the db or not? The use case here is I have a update snake page that when you select a snake from the dropdown I pull all the data from the db and then update the form with the information so it can be modified.
This works fine for everything except the image object because of the error above I was just trying to set my uploader file to include the file I already have but I guess my only option is to just let them upload a new file and if there is one there then we modify the existing one in the db or is there a better way to do this?
self.snake_image.file = snake_record['snake_pic'] where snake_record[‘snake_pic’] is a image object in my db this is where this error is obviously coming from. Wasn’t sure if maybe I should just load the image there next to the uploader and give a new upload option, etc still trying decide the best approach.
Images can have their source property set to a Media object. So if you have a file stored as a Media object in a Data Table, you can retrieve it and assign it to the source property of your image.
For example, if I have a table named ‘files’ with a column named ‘contents’ that contains Media objects, I can do