Django: Ticket Query!closed&reporter=Pyth&order=priority The Web framework for perfectionists with deadlines. en-US Django!closed&reporter=Pyth&order=priority Trac 1.0 #9894: Give the FileField 'upload_to' callable access to an UploadedFile's contents. Sat, 20 Dec 2008 02:17:03 GMT Pyth <p> <tt>FileField.upload_to</tt> allows for a callable and requests an <tt>instance</tt> and a <tt>filename</tt>. Because it may be of interest to the programmer to use the file's content (MD5 sum, MIME type, ID3 tags etc.) in the upload path, it would be handy to be able to access it from the callable method. </p> <p> One possibility would be to pass an <tt>UploadedFile</tt> instead of a <tt>filename</tt> but this would break the compatibility policy in 1.0.X. Temporarily, this functionality could be added via an <tt>uploaded_file</tt> or <tt>content</tt> property added to the instance (in <tt></tt>), making it accessible from the <tt>upload_to(instance, filename)</tt> callable with <tt>instance.uploaded_file</tt>. </p> <p> I'll throw up some patches if this makes any sense. </p> Results