Parse to Coronium

Hi,

We have migrated our parse code to coronium code. There is only things we need to know how to fix. We are using the uploading file functionalities and we need to make some clean-up from time to time as we do not want to keep accumulating files.

Parse was good with this as we could clean file that were not linked to a parse object.

How can we access the uploaded file in Coronium so we can clean those files ?

thanks

NIck

I’m going to move this to the Coronium forum.

Rob

Hi Nick,

You’d want to create a collection in Mongo (or MySQL) that stores your uploaded references. You can use this along with Jobs to implement your clean up routine.

Hope that helps,

Cheers

Hi Chris, this is a good idea, the only things unclear is how do we delete a file within a job ? Is there an API we can use ? (the rest is any enough)

Hi,

You should be able to use the Lua API, something like:

[lua]

local os = require(‘os’)

local ok, err = os.remove(“filepath”)

if not ok then

  --Got error

  coronium.log(err)

end

[/lua]

Not tested, but that should work. Let me know.

http://www.lua.org/manual/5.1/manual.html#pdf-os.remove

Cheers.

I’m going to move this to the Coronium forum.

Rob

Hi Nick,

You’d want to create a collection in Mongo (or MySQL) that stores your uploaded references. You can use this along with Jobs to implement your clean up routine.

Hope that helps,

Cheers

Hi Chris, this is a good idea, the only things unclear is how do we delete a file within a job ? Is there an API we can use ? (the rest is any enough)

Hi,

You should be able to use the Lua API, something like:

[lua]

local os = require(‘os’)

local ok, err = os.remove(“filepath”)

if not ok then

  --Got error

  coronium.log(err)

end

[/lua]

Not tested, but that should work. Let me know.

http://www.lua.org/manual/5.1/manual.html#pdf-os.remove

Cheers.