Skip to content

Add request information to FilesAdapter to be able to store files based in request info (like IP address) #6986

@sarsonj

Description

@sarsonj

Hi,

we are using S3 adapter for storing our files. Because of our app stores user's data (not public one), we wanted to store data to servers, that are close to users. It means EU users on EU servers, US users on US servers and so on. It also helps us to be GDPR complaint.

We tried to write our custom FIlesAdapter based on existing S3 adapter, but we realised, that it is not possible to get request information in FilesAdapter - we wanted to use client IP address to resolve location through GeoIP.

The proposal

I looked, that this should be relatively easy to inject additional data to FilesAdapter - in FilesRouter's createFile function we can send additional data to filesController. The FilesAdapter interface then can be extended by adding request parameter to createFile function.

Yes, this is breaking change, so that another option is to use options parameter in createFile method, that is already here.

Options considered

We were thinking about creating cloudCode function, that will emulate ParseFile functionality - it will get fileName and byte[] data and then store it. However, I am not sure, if it will not have impact on performance - doest Parse File has some special handing for large files upload or so? We will also lost functionality that Parse File provides and break code in our app, that is currently using Parse File.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions