# File upload and custom script service

**URL:** <https://community.dreamfactory.com/t/file-upload-and-custom-script-service/2557>\
**Category:** Server-Side Scripting\
**Created:** [April 19, 2016, 11:04pm UTC](https://community.dreamfactory.com/t/file-upload-and-custom-script-service/2557 "2016-04-19T23:04:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![andersonmuller](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@andersonmuller](https://community.dreamfactory.com/u/andersonmuller)\
**Post date:** [April 19, 2016, 11:04pm UTC](https://community.dreamfactory.com/t/file-upload-and-custom-script-service/2557/1 "2016-04-19T23:04:47Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![samsfisher](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@samsfisher](https://community.dreamfactory.com/u/samsfisher)\
**Post date:** [June 19, 2016, 9:20pm UTC](https://community.dreamfactory.com/t/file-upload-and-custom-script-service/2557/3 "2016-06-19T21:20:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andersonmuller](https://avatars.discourse-cdn.com/v4/letter/a/7feea3/32.png) [@andersonmuller](https://community.dreamfactory.com/u/andersonmuller)\
**Post date:** [June 24, 2016, 1:41pm UTC](https://community.dreamfactory.com/t/file-upload-and-custom-script-service/2557/4 "2016-06-24T13:41:00Z")

</div>

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
