← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1433765] [NEW] FileField clean up temp file and and get file size without loading file

 

Public bug reported:


We are using forms.FileField to upload a client local file. 

We noticed that if the file size is big, for example 7 gb,  Horizon
dumps a temp file in /tmp dir where horizon server runs. If the file
loaded is different each time, the temp files are left in the /tmp. Over
the long run, it could overflow the disk spaces.

We would like to have a way to clean up the tmp file once file loading
is done.

The way that we use to get the file handle  in the form's clean or
handle method is :

f = self.request.FILES['file"]

If we use this to get the file size in the clean method to validate, the
whole file gets loaded either into memory or to temp dir,  it would be
nice to get the file size without loading the whole file.

** Affects: horizon
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1433765

Title:
  FileField  clean up temp file and and get file size without loading
  file

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  
  We are using forms.FileField to upload a client local file. 

  We noticed that if the file size is big, for example 7 gb,  Horizon
  dumps a temp file in /tmp dir where horizon server runs. If the file
  loaded is different each time, the temp files are left in the /tmp.
  Over the long run, it could overflow the disk spaces.

  We would like to have a way to clean up the tmp file once file loading
  is done.

  The way that we use to get the file handle  in the form's clean or
  handle method is :

  f = self.request.FILES['file"]

  If we use this to get the file size in the clean method to validate,
  the whole file gets loaded either into memory or to temp dir,  it
  would be nice to get the file size without loading the whole file.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1433765/+subscriptions


Follow ups

References