Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Delete tmp photo after photo storage #2

Closed
frankrousseau opened this issue May 20, 2013 · 2 comments
Closed

Delete tmp photo after photo storage #2

frankrousseau opened this issue May 20, 2013 · 2 comments
Assignees

Comments

@frankrousseau
Copy link
Contributor

Actually, when a photo is uploaded, the application saves it temporary in the tmp folder. Once all operations are done, an useless version of the photo is kept in the tmp folder.
It would be better to delete it.

@ghost ghost assigned aenario May 20, 2013
@aenario
Copy link
Contributor

aenario commented May 21, 2013

During upload, the application use the ./uploads folder. A typo prevented delete from this folder (fixed in d9504d4)

However, the following piece of code also creates a file in the /tmp folder

Photo = require './server/models/photo.coffee'

photo =
    title: "Photo 1"
    rawpath: "./server/_specs/fixtures/test.jpg"

Photo.create photo, (err, photo) ->
    return res.error 500, "Creation failed.", err if err
    data = name: 'raw', type: "image/jpeg"
    photo.attachFile photo.rawpath, data, -> console.log "ok"

so it appears jugglingdb-cozy-adapter creates files in the /tmp folder.

Is this an issue on linux ?

@frankrousseau
Copy link
Contributor Author

No I think, that's the Data System that does not delete the file after receiving an attachment:
https://github.com/mycozycloud/cozy-data-system/blob/master/app/controllers/attachment_controller.coffee#L36-L55

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants