# Writing to an USB Flash Drive

**URL:** <https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587>\
**Category:** Rails\
**Created:** [December 19, 2007, 12:11am UTC](https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587 "2007-12-19T00:11:47Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![artybala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@artybala](https://www.ruby-forum.com/u/artybala)\
**Post date:** [December 19, 2007, 12:11am UTC](https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587/1 "2007-12-19T00:11:47Z")

</div>

Hi.,

I would like to provide my website visitors the ability to store  
images from the site in to a USB flash drive. User will click the  
image or pressing a submit button after selecting it. Can some one  
guide me on how I can do this using ROR?

Any help is much appreciated.

Thanks  
Bala

---

<div class="post-metadata">

**Author:** ![artybala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@artybala](https://www.ruby-forum.com/u/artybala)\
**Post date:** [December 19, 2007, 12:33am UTC](https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587/2 "2007-12-19T00:33:59Z")

</div>

This is more of a usability problem, it’s nothing RoR can do itself  
since  
RoR can’t tell if a user has a flash drive installed and what drive it’s  
installed as.

On Dec 19, 2007 9:40 AM, artybala [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks  
> Bala
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

---

<div class="post-metadata">

**Author:** ![artybala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@artybala](https://www.ruby-forum.com/u/artybala)\
**Post date:** [December 19, 2007, 4:09pm UTC](https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587/3 "2007-12-19T16:09:48Z")

</div>

Look up the docs for send\_file or send\_data and, in particular,  
the :disposition and :filename options.

-Rob

---

<div class="post-metadata">

**Author:** ![artybala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@artybala](https://www.ruby-forum.com/u/artybala)\
**Post date:** [December 19, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587/4 "2007-12-19T22:01:56Z")

</div>

Thanks Rob. Will check on that. Anyway i can supress the “save/open/  
cancel” window and directly save it the thumb drive?

On Dec 19, 9:09 am, Rob B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![artybala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@artybala](https://www.ruby-forum.com/u/artybala)\
**Post date:** [December 19, 2007, 10:13pm UTC](https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587/5 "2007-12-19T22:13:57Z")

</div>

Removing the dialog would be bad (if it is even possible). I have like  
to  
determine where the photos are going to be saved on my own computer.

Is this going to be a kiosk type thing where USB is the only option?

---

<div class="post-metadata">

**Author:** ![artybala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@artybala](https://www.ruby-forum.com/u/artybala)\
**Post date:** [December 19, 2007, 11:03pm UTC](https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587/6 "2007-12-19T23:03:20Z")

</div>

This is not possible because of security reasons. It would give you  
the possibility  
to write arbitrary data to every place on disk that the user has  
access to without his  
knowledge. (On Windows XP: usually everywhere, like… boot.ini? Any  
EvE players  
here?)

---

<div class="post-metadata">

**Author:** ![artybala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@artybala](https://www.ruby-forum.com/u/artybala)\
**Post date:** [December 19, 2007, 10:44pm UTC](https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587/7 "2007-12-19T22:44:25Z")

</div>

It is not like a kiosk, but USB thumb drive is the designed option.  
Say you want to select photos from flikr and  
take it to costco for printing. i don’t want my user to do a “save as”  
or anything. one click it goes to the thumb  
drive straight.!

Thanks.

---

<div class="post-metadata">

**Author:** ![artybala](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/9de0a6/32.png) [@artybala](https://www.ruby-forum.com/u/artybala)\
**Post date:** [December 20, 2007, 4:11pm UTC](https://www.ruby-forum.com/t/writing-to-an-usb-flash-drive/123587/8 "2007-12-20T16:11:38Z")

</div>

Thanks Florian.
