SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jan 2005
    Location
    india
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Uploding a file onto a server

    Hi

    I want to uplaod a file from the browser and store it in a specific location on the server using ruby on rails. Right now i am using webrick and the path of my application is c:\project_name.
    Do you guys have any idea .
    Thanks a lot

    Gaurav

  2. #2
    SitePoint Enthusiast AdulteratedJedi's Avatar
    Join Date
    Mar 2002
    Location
    East Yorkshire, UK
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have a read of How to Upload files, In Ruby on Rails on the RoR WIKI

    AJ

  3. #3
    SitePoint Member
    Join Date
    Jan 2005
    Location
    india
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks a lot but what i need to do is that, i need to attach a file through the browser and then store it in a folder on the server ..

    The method given in wiki is for appending picture to a file ..
    This doesnot solve my problem

    Do you have any solution to that
    Can you tell me if file_column can be used for this or not

    Thanks
    Gaurav

  4. #4
    SitePoint Zealot
    Join Date
    Nov 2004
    Location
    Yakima WA.
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes file_column is what you want. But the example on the wiki can be used for any type of file or images as well.

  5. #5
    SitePoint Member
    Join Date
    Jan 2005
    Location
    india
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it also possible using file_column to download the uploaded file .the files which are usually uploaded are either(.doc),(.txt) or(.pdf).if there is some other method please do tell me.
    On the click of the file name i want to download that file which is uploaded
    Last edited by Gauravbehl1; Dec 16, 2005 at 01:37.

  6. #6
    SitePoint Zealot
    Join Date
    Nov 2004
    Location
    Yakima WA.
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes that is possible. You wont use file_column to do the downloads though. File_column stores the actual files on disk and stores the file path in the database. So you can just use the file path out of the db and make normal links to the files and the browser takes care the download. You might need to set disposition:attachment headers for some of those file types so they actually download and don't just print into the browser as text.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •