File upload and custom script service


#1

Hi,

I have a custom script and with postman I upload a file(image) to this service.
How can I access the upload data with a custom script? I dont receive nothing in content, payload or parameters. I’m using DF 2.1.1-2

If I add the header Content-Type: multipart/form-data, I receive this error every time, even if my script is empty:

"error": {
    "context": null,
    "message": "Script did not return an expected format: ",
    "code": 500
}

and in dreamfactory.log:

 Exception executing javascript: script.users:8: SyntaxError: Unexpected token ;

Any help will be appreciated.

Thanks!


Access multipart/form-data information
#3

I am in the same boat as you are. i want to process a file as part of the POST request. i dont want to create a file service and then a post upload event.

In short i am trying to upload a csv file to update the database.

What solution did you finally come up with?

Sam


#4

Hi @samsfisher,

I haven’t tested with the last two versions.
Our workaround was convert the image to base64 (in the app) and then send to DF (as a param in the payload).

Cheers