# Handling an html5 drag n' drop upload

**URL:** <https://www.ruby-forum.com/t/handling-an-html5-drag-n-drop-upload/189734>\
**Category:** Rails\
**Created:** [June 6, 2010, 3:34pm UTC](https://www.ruby-forum.com/t/handling-an-html5-drag-n-drop-upload/189734 "2010-06-06T15:34:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [June 6, 2010, 3:34pm UTC](https://www.ruby-forum.com/t/handling-an-html5-drag-n-drop-upload/189734/1 "2010-06-06T15:34:25Z")

</div>

Hi,

I’ve started implementing an html5 drag n’ drop upload feature. It’s to  
the point where the file is being uploaded and on the server-side I can  
fetch the filename with request.env[‘HTTP\_X\_FILE\_NAME’], but how to save  
the file content?

In which parameter is it located? I tried request.body, but it doesn’t  
reproduce the initial file. I tried Base64 decoding also, but not luck?

Has anyone done work on that?

Thanks

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [August 4, 2010, 11:40am UTC](https://www.ruby-forum.com/t/handling-an-html5-drag-n-drop-upload/189734/2 "2010-08-04T11:40:53Z")

</div>

Hi Fernando P.,

```
    request.raw_post use this in controller you will be getting 

```

the post data complete file content .

```
     Then you can write the content in to the file and save in the 

```

filesystem.

Thanks

Fernando P. wrote:

> Hi,
> 
> I’ve started implementing an html5 drag n’ drop upload feature. It’s to  
> the point where the file is being uploaded and on the server-side I can  
> fetch the filename with request.env[‘HTTP\_X\_FILE\_NAME’], but how to save  
> the file content?
> 
> In which parameter is it located? I tried request.body, but it doesn’t  
> reproduce the initial file. I tried Base64 decoding also, but not luck?
> 
> Has anyone done work on that?
> 
> Thanks
