Forum: Ruby on Rails Access Client's File System from Rails application deployed at Heroku (for instance)

Posted by sagar p. (sagar_p)
on 2013-01-26 03:44
Hi,

Part of the Rails application, I want to let the client keep the
location string of a video file in the database at Heroku(My plan is to
deploy the application at Heroku). So, when the client wants to access
his or her file, the Rails application gets the location string from the
database and opens the matching local file from his or her computer. Is
this possible???

I appreciate  your opinion/suggestion.

Regards,
Sagar
Posted by Jordon Bedwell (Guest)
on 2013-01-26 03:53
(Received via mailing list)
On Fri, Jan 25, 2013 at 8:44 PM, sagar p. <lists@ruby-forum.com> wrote:
> Part of the Rails application, I want to let the client keep the
> location string of a video file in the database at Heroku(My plan is to
> deploy the application at Heroku). So, when the client wants to access
> his or her file, the Rails application gets the location string from the
> database and opens the matching local file from his or her computer. Is
> this possible???

No.  Just no.
Posted by Dave Aronson (Guest)
on 2013-01-26 04:04
(Received via mailing list)
On Fri, Jan 25, 2013 at 9:44 PM, sagar p. <lists@ruby-forum.com> wrote:

> the Rails application gets the location string from
> the database and opens the matching local file
> from his or her computer. Is this possible???

To expand on Jordon's "Just no":

Heroku does not provide any local filesystem whatsoever.  The only
files you can count on being there, are what your uploaded application
initially installs.  The whole point of cloud-based automagically
scaling solutions like Heroku is that (assuming you spring for the
non-free plans) you get new resources spun up and down as needed.
Obviously they won't have all the local files that your app has
created.

HOWEVER...

There is a common solution to this, namely cloud *storage*.  Store the
files on Amazon S3 or some such, and it will be a bit more complex
than local storage but still quite feasible... and cheap so long as
you don't store huge files or a huge number of them.

-Dave

--
Dave Aronson, the T. Rex of Codosaurus LLC,
secret-cleared freelance software developer
taking contracts in or near NoVa or remote.
See information at http://www.Codosaur.us/.
Posted by sagar p. (sagar_p)
on 2013-01-26 04:24
Thank you, Jordon and Dave.

I apologize if I am unclear. My question was to access client's local 
file system, not the Heroku's. I wonder if your answer still sticks to 
'NO'.

S3 is not an option for me right now, because the application would 
require user to save the video clip and get ready for another clip in a 
matter of 20-30 seconds. Also, the application would be used in an area 
where the internet speed is not that high (about 128 kbps). So, I want 
to minimize the network traffic as much as possible.

Regards,
Sagar

Dave Aronson wrote in post #1093867:
> On Fri, Jan 25, 2013 at 9:44 PM, sagar p. <lists@ruby-forum.com> wrote:
>
>> the Rails application gets the location string from
>> the database and opens the matching local file
>> from his or her computer. Is this possible???
>
> To expand on Jordon's "Just no":
>
> Heroku does not provide any local filesystem whatsoever.  The only
> files you can count on being there, are what your uploaded application
> initially installs.  The whole point of cloud-based automagically
> scaling solutions like Heroku is that (assuming you spring for the
> non-free plans) you get new resources spun up and down as needed.
> Obviously they won't have all the local files that your app has
> created.
>
> HOWEVER...
>
> There is a common solution to this, namely cloud *storage*.  Store the
> files on Amazon S3 or some such, and it will be a bit more complex
> than local storage but still quite feasible... and cheap so long as
> you don't store huge files or a huge number of them.
>
> -Dave
>
> --
> Dave Aronson, the T. Rex of Codosaurus LLC,
> secret-cleared freelance software developer
> taking contracts in or near NoVa or remote.
> See information at http://www.Codosaur.us/.
Posted by Jordon Bedwell (Guest)
on 2013-01-26 04:49
(Received via mailing list)
On Fri, Jan 25, 2013 at 9:24 PM, sagar p. <lists@ruby-forum.com> wrote:
> I apologize if I am unclear. My question was to access client's local
> file system, not the Heroku's. I wonder if your answer still sticks to
> 'NO'.

This is exactly what my "no, just no" referred to.  And not for any
more reason than it's a huge security risk that you should not throw
you or your users into unless you absolutely know what you are doing
and they absolutely understand the risk they are taking.
Posted by Jordon Bedwell (Guest)
on 2013-01-26 04:51
(Received via mailing list)
On Fri, Jan 25, 2013 at 9:48 PM, Jordon Bedwell <envygeeks@gmail.com> 
wrote:
> On Fri, Jan 25, 2013 at 9:24 PM, sagar p. <lists@ruby-forum.com> wrote:
>> I apologize if I am unclear. My question was to access client's local
>> file system, not the Heroku's. I wonder if your answer still sticks to
>> 'NO'.
>
> This is exactly what my "no, just no" referred to.  And not for any
> more reason than it's a huge security risk that you should not throw
> you or your users into unless you absolutely know what you are doing
> and they absolutely understand the risk they are taking.

To elaborate there are other reasons why the no applies, but this is
the only reason I care about.
Posted by sagar p. (sagar_p)
on 2013-01-26 04:59
Thank you both of you.

Regards,
Sagar

Jordon Bedwell wrote in post #1093870:
> On Fri, Jan 25, 2013 at 9:48 PM, Jordon Bedwell <envygeeks@gmail.com>
> wrote:
>> On Fri, Jan 25, 2013 at 9:24 PM, sagar p. <lists@ruby-forum.com> wrote:
>>> I apologize if I am unclear. My question was to access client's local
>>> file system, not the Heroku's. I wonder if your answer still sticks to
>>> 'NO'.
>>
>> This is exactly what my "no, just no" referred to.  And not for any
>> more reason than it's a huge security risk that you should not throw
>> you or your users into unless you absolutely know what you are doing
>> and they absolutely understand the risk they are taking.
>
> To elaborate there are other reasons why the no applies, but this is
> the only reason I care about.
Posted by tamouse mailing lists (Guest)
on 2013-01-26 05:30
(Received via mailing list)
On Fri, Jan 25, 2013 at 8:44 PM, sagar p. <lists@ruby-forum.com> wrote:
> Part of the Rails application, I want to let the client keep the
> location string of a video file in the database at Heroku(My plan is to
> deploy the application at Heroku). So, when the client wants to access
> his or her file, the Rails application gets the location string from the
> database and opens the matching local file from his or her computer. Is
> this possible???

You wish to keep the path of a file that exists on the user's local
machine in your database in the cloud, and pass it back to the user?

I cannot begin to see how this would be possible unless your user had
a server running on their localhost that could serve up the file.

Trying to set a URL like `file:///home/username/somefile` cannot work
when you set it in a web page:

<a href="file:///home/username/somefile">somefile</a>

does not work when your web page is being served from elsewhere. Try
it. There are extremely good reasons for this.
Posted by Miguel Morales (Guest)
on 2013-01-26 08:00
(Received via mailing list)
Depending on what you're trying to do there might be some java or flash
applet that will let you do that.
Theoretically you could just store the path and tell the applet to open
that file.

Your users would have to agree to install the applet and understand the
risks.

On Fri, Jan 25, 2013 at 7:50 PM, Jordon Bedwell <envygeeks@gmail.com> 
wrote:

> > and they absolutely understand the risk they are taking.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>


--
~ Jeremiah:9:23-24
Android 2D MMORPG: http://solrpg.com/,
http://www.youtube.com/user/revoltingx
Posted by sagar p. (sagar_p)
on 2013-01-28 19:48
I came across this FileSystem API in the DOM, that allows clients to 
store and retrieve files from user's Sandbox. I have not had a chance to 
play with it yet, but seems like a bright light to me.

http://www.html5rocks.com/en/tutorials/file/filesystem/

Regards,
Sagar


tamouse mailing lists wrote in post #1093872:
> On Fri, Jan 25, 2013 at 8:44 PM, sagar p. <lists@ruby-forum.com> wrote:
>> Part of the Rails application, I want to let the client keep the
>> location string of a video file in the database at Heroku(My plan is to
>> deploy the application at Heroku). So, when the client wants to access
>> his or her file, the Rails application gets the location string from the
>> database and opens the matching local file from his or her computer. Is
>> this possible???
>
> You wish to keep the path of a file that exists on the user's local
> machine in your database in the cloud, and pass it back to the user?
>
> I cannot begin to see how this would be possible unless your user had
> a server running on their localhost that could serve up the file.
>
> Trying to set a URL like `file:///home/username/somefile` cannot work
> when you set it in a web page:
>
> <a href="file:///home/username/somefile">somefile</a>
>
> does not work when your web page is being served from elsewhere. Try
> it. There are extremely good reasons for this.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.