Luis Lavena wrote:
> On Tue, Sep 14, 2010 at 9:39 AM, Amit Tomar <> 
> wrote:
>> sorry luis but i didn't get you
>> i uploaded my file in filesystem than how ?can ?i place file in public
>> folder
>> could you please give some example??
> Are you using a plugin to manage your uploads? How are you saving the 
> file?
> Take the temporary file and use File.move or, wonder what
> are you doing right now for that.
> Please use google to search, there are plenty of file uploading
> tutorials about Ruby on Rails on the internet covering "do from
> scratch" or using gem/plugins.
> --
> Luis Lavena
> AREA 17
> -
> Perfection in design is achieved not when there is nothing more to add,
> but rather when there is nothing more to take away.
> Antoine de Saint-Exupé²¹

this is how am uploading
def upload(params)

        path = get_path(params), "wb") do |f|
        while buff= params[:location].read(4096)


def get_path(params)
          name = params[:location].original_filename
    directory  = "//"
                path = File.join(directory, name)
          return path

def copyFile(uploaded_file)
            @uploaded_file = uploaded_file
            directory = "//"
            #url_dir = "data"
            url_dir = "//"
            name = File.basename(@uploaded_file)
            path = File.join(directory, name)
          if (!FileTest.exist?(path))
             FileUtils.copy @uploaded_file, path
               return "duplicate"

            url = File.join(url_dir, name)
            return url


and after copying it filesystem
Posted via
Mongrel-users mailing list

Reply via email to