Question

I am trying to make Jquery File Upload to work and I'd like an advice about storing the files and particularly I am concerned about the situation when a user chooses a few files so they get downloaded to the server and then user just closes the browser or the tab or whatever, so I have extra files on my server which wont be used and therefore I will have to come up with something to remove these extra files... So the question is, how is it usually handled? What's the 'best practice' ?

btw, I am using ruby on rails and carrierwave, if that matters

Était-ce utile?

La solution

Apart from running a websocket script (to check when the user closes the browser), I feel the most efficient way to do this is to run a scheduled task

Images

It will all hinge on how you'll associate your images with resources on your server. For example, if the images are meant to be used in a piece of content (which is not saved), you can check for the existence of the content, and delete any image which has no association

Like many software systems, the "best practice" will only become apparent if you detail some context to your query. For example -- what are the images for & how will they be managed?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top