How to intercept S3 file upload


#1

Hi all,

We’re trying to intercept an image upload to a DreamFactory S3 connected service in order to generate a thumbnail of the image. We’re using DF 2.2.0.

It seems not possible to access the uploaded data in the pre o post-process event scripts of the POST to the s3 service.
How is it possible?

Thanks in advance.


#2

Nobody tried this before? No hints?


#3

Unfortunetly we don’t provide many Server Side Scripting examples. But, @zerox12 below created a Github repo to collect them! So if you create some, please do post there…or, you may find something similar to what you are looking for.

Thanks,
Alex
@DFCommunityManager


#4

I’m not sure if you can get the data directly, maybe the developers can answer that.

However, couldn’t you do it in the post-process script? Just make an API call to get the file which was just uploaded, then create your thumbnail and make another api call to save it back to file storage.

Not that efficient, but if the images is stored on DF itself it shouldn’t be a performance issue.


#5

Thanks @zerox12, actually we’re doing something similar. Indeed it would be much more efficient if we could intercept the data as it is uploaded.