# Capistrano put

**URL:** <https://www.ruby-forum.com/t/capistrano-put/87694>\
**Category:** Rails\
**Created:** [March 5, 2007, 9:04am UTC](https://www.ruby-forum.com/t/capistrano-put/87694 "2007-03-05T09:04:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stemey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@stemey](https://www.ruby-forum.com/u/stemey)\
**Post date:** [March 5, 2007, 9:04am UTC](https://www.ruby-forum.com/t/capistrano-put/87694/1 "2007-03-05T09:04:46Z")

</div>

Hi,

I have tried to use “put” in my capistrano task to upload a zip file.  
Unfortunately it gets corrupted. This is the code:

put(File.read(“releases/current/source.zip”),  
“/home//releases/current/source.zip”,  
:mode =\> 0444)

Do I have to set a parameter saying that it is a binary file? The  
local server is a windows box and the remote ones are linux/debian.

Thanks,  
Stefan

---

<div class="post-metadata">

**Author:** ![stemey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@stemey](https://www.ruby-forum.com/u/stemey)\
**Post date:** [March 5, 2007, 9:26am UTC](https://www.ruby-forum.com/t/capistrano-put/87694/2 "2007-03-05T09:26:49Z")

</div>

Hey Stefan, could you provide a transcript of the error message that  
you’re receiving?

-Conrad

---

<div class="post-metadata">

**Author:** ![stemey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@stemey](https://www.ruby-forum.com/u/stemey)\
**Post date:** [March 5, 2007, 6:24pm UTC](https://www.ruby-forum.com/t/capistrano-put/87694/3 "2007-03-05T18:24:20Z")

</div>

Quick fix… Delete the destination file first.

delete "/home//releases/current/source.zip"put(File.read  
(“releases/current/source.zip”),  
“/home//releases/current/source.zip”,  
:mode =\> 0444)

That fixed it for me.

Regards, Lori
