Hey there,

Is there any way to skip saving a file to the /tmp directory on a
server?
I got in a lot of trouble from my host when they found 10,000 files
just sitting there from a Django script I'd been running to import
book covers from an API.

So far, the guts of my save code are:

Save the file:
 - item.cover.save("cover name", File(open(the_file_itself)),
save=True)

Within def save() in the model, I send it to S3:
 - temp_file = "This is where the Model saves the file,
upload_to="files/"
 - filedata = open(temp_file, 'rb').read()
 - conn.put(BUCKET_NAME, S3_PATH, s3.S3Object(filedata), {'x-amz-acl':
'public-read', 'Content-Type': 'image/jpeg'})

So, I'm guessing as a default it creates the file under the servers "/
tmp" directory?
This is what I need to change.

I tried:
FILE_UPLOAD_TEMP_DIR = "/a/better/directory/tmp"

But it hasn't changed anything.

Any ideas would be great,
Thanks so much ...

Danny

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to