Forum: Ruby on Rails Can [ruby] on rails do this --- crazy request

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
903de3fe51f14392609e28e82e1b1c6c?d=identicon&s=25 Rick Fiorentino (rickf)
on 2007-03-21 19:14
Hi all,

Loving the Ruby on Rails world so far.

My web app needs to browse the local file system for file names and
directories to build lists for processing with a commercial application.
I realize this is a no no for web client apps due to security concerns.
One approach is to write signed java applets to integrate this
functionality. While this would work, I was curious if it is possible to
make a signed piece of ruby code to do the same thing?

The code could be RJS based and signed. Is there any way to make this
happen and keep out of the java world? Is jruby a possibility?

Thanks any help is greatly appreciated,
Rick
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2007-03-21 20:45
(Received via mailing list)
Rails has nothing to do with this (being the server and all, no
interaction
with client computers). Java applets work because they are run on the
client. Javascript is not allowed to do much in this space, last I
checked,
so you're basically stuck with a Flash or Java app embedded in the page
that
can post back to the server.

Jason
Fbd9cb107fe7c941333d6a3488691989?d=identicon&s=25 Ramon Tayag (ramontayag)
on 2007-03-22 04:23
(Received via mailing list)
I do know that Flash 8+ has an upload window but I'm not sure if it
can scour the drive to list all the files.  You may want to check that
out.  If not, then the java applet is the answer for you.

On 3/22/07, Rick Fiorentino <rails-mailing-list@andreas-s.net> wrote:
> make a signed piece of ruby code to do the same thing?
>
> The code could be RJS based and signed. Is there any way to make this
> happen and keep out of the java world? Is jruby a possibility?
>
> Thanks any help is greatly appreciated,
> Rick

--
Ramon Miguel M. Tayag
8acba6d057b3f0c2c16cca95ad36881b?d=identicon&s=25 Bakki Kudva (bakki)
on 2007-03-22 22:42
(Received via mailing list)
Have you looked at the Ruby shell library? It is part of the standard
installation. On Linux you'll find it at
/usr/lib/ruby/1.8/shell

You can look up the Shell class and its methods at
http://www.ruby-doc.org/core/

You can do anything you'd from the command line and pass values back and
forth.
You can write your own classes and put the file in the RAILS_ROOT/lib
dir.

I am using it to do some file format conversions. To see how shell is
used you can look into the doc_convert library to see how shell is
used. That's what I did.
http://raa.ruby-lang.org/project/doc_convert/

Hope this helps,

bakki
7c8f8b6eae4dd991e3a9065c68451361?d=identicon&s=25 Wai Tsang (sneptune)
on 2007-03-23 01:58
Rick Fiorentino wrote:
> Hi all,
>
> Loving the Ruby on Rails world so far.
>
> My web app needs to browse the local file system for file names and
> directories to build lists for processing with a commercial application.
> I realize this is a no no for web client apps due to security concerns.
> One approach is to write signed java applets to integrate this
> functionality. While this would work, I was curious if it is possible to
> make a signed piece of ruby code to do the same thing?
>
> The code could be RJS based and signed. Is there any way to make this
> happen and keep out of the java world? Is jruby a possibility?
>
> Thanks any help is greatly appreciated,
> Rick

When you said your web app needs to browse the local file system, does
it means the file system of the web server or does it means the file
system of the people browsing/access your web page?  If it is the
former, it is simple using the File Class.  If it is the later, I am not
sure.  If it is file upload, you can use the file_field_tag.

On the other hand, if you can run application on the client end, then
you can build one with ruby that look up the workstation's file system
and send appropriate messages to the server (with backgroundrb?)
903de3fe51f14392609e28e82e1b1c6c?d=identicon&s=25 Rick Fiorentino (rickf)
on 2007-03-23 13:13
> When you said your web app needs to browse the local file system, does
> it means the file system of the web server or does it means the file
> system of the people browsing/access your web page?

Sorry if I wasn't clear. The file browsing would be on the client end in
the web browser. The user will need to specify lists of files and
directories for processing by the main application.

Although I have seen people do tricks with the file upload, this is a
little clunky for my needs.

Thanks for all the possibilities.
This topic is locked and can not be replied to.