similar to: handling file upload onto local filesystem.

Displaying 20 results from an estimated 2000 matches similar to: "handling file upload onto local filesystem."

2006 Apr 05
6
How to Upload Image through RoR??
Hi, I have one form , in which I am using file_field teg for input image file as follows. ===== <%= file_field("store", "picture") %> ======= Tha Actual fileld name of my Image field in Database is "store_photo" with datatype LargeBLOB. & Inside my Store Model I have specified "def picture" as follows:- ========================= def
2006 Mar 04
13
file_column
Restricting size of an uploaded file, is how is that possible? If I do not want a user to upload a file larger than X bytes, can it easily be done? If I also would like restrict the types of files that can be uploaded, how may I do so? Thank you, Sharkie
2006 Apr 25
3
limiting options in file_upload
Does anyone know if it''s possible to set constraints to the size & type of file that file_column will accept? I''d like to limit to image files of less than 2MB. If this isn''t possible with file_column, is there a graceful way of getting the controller to handle it? thanks dorian -- -- I do things for love or money
2006 May 31
4
acts_as_attachment , someone using it?
Hi, i just found the acts_as_attachment plugin for image upload, seems sogood but i cant find any docs about it, if someone here using it can give some references or working examples about the plugin that will be excellent. So what you wanna rails today? -- Posted via http://www.ruby-forum.com/.
2006 Jul 20
1
file_column - assigning with an actual file rather than a multipart
Hi there, I''m using the wonderful file_column and have struck an issue that someone might have seen before. My images already sit on the server. So, instead of passing a multipart message I''m sending a file object. Something like... f = File.new("public/gallery_images/builder.png") p = Product.find_first p.image = f p.save On the save I recieve an error which
2005 Sep 07
0
model constructor errors.
I have a model; I do photo = Photo.new(parameters) parameters contains: {"picture"=>#<File:C:/DOCUME~1/BART~1/LOCALS~1/Temp/CGI3180.1>} so i expect that the def picture=(filename) method is called in this constructor.. this is not the case. Does anyone know why? params[:photo].each_pair do |id, parameters| photo = Photo.new(parameters) end class Photo
2006 Feb 20
3
file_column and login_engine incompatibilities
Hi, has anyone come across any incompatibilities between file_column and login_engine? I''ve been having strange issues where a User model with file_column in it is failing to save the images properly. Everything uploads to the tmp dir fine, but then it never gets copied to the proper permanent location. No errors - everything happens fine except for that final part. I have
2006 Mar 15
1
file_column imagemagick strangeness
Hi, I''m using the basic magick features of file_column, and while files are uploading fine without the magick options, as soon as I do something like :magick => { :size => "400x600" } I get an ''invalid file'' error. Further investigation reveals that the file is in fact invalid because something somewhere is truncating the file path:
2005 Dec 31
4
How might I use file_column for incoming email attachments?
I''m writing a ''Mailman'' model that catches emails sent to my application (kind of like backpack, I think). The trouble is that I''d like to save image attachments in the same was that file_column saves them--in fact, I''d really like to use a simple assignment like photo.image = attachment to save the image in its proper place. However,
2007 Apr 27
3
Image upload problem.
I''ve seen posts of a few people who have this problem, but not a single response about solving it. I can''t upload .png files, but .jpg and .gif work fine. When I upload just a .png, my action gets a StringIO object which breaks when I try to copy the upload to an absolute location. However, using multiple-field upload, as long as one of the to-upload files is *not* a .png, all
2008 Jun 15
11
Ouch! Can't figure out this file upload issue...
Okay, so this is driving me crazy. I''m trying to do a file upload using code from a book. What happens: I get wrong number of arguments (1 for 0) in the upload controller save action. No idea why. Schema: The schema for the picture model object is just a textfield named comments and a binary field called data. Upload controller: def get @picture =Picture.new end def save
2006 Mar 24
1
upload a file to server???
Hi, We would like to upload a file to the server, like user chooses a file with a browse button, then click on a OK button, then the browser send the file to the server, does anyone know how to do it in rails? Thanks you very much Saiho The mind is its own place, and in itself. Can make a Heaven of Hell, a Hell of Heaven. http://www.geocities.com/sayoyo/
2006 May 04
5
How to upload only jpeg & gif & png images into public/images using rubyonrails
Hello iam new to rubyonrails. Please any one help me out in "How to upload only jpeg & gif & png images into public/images using rubyonrails" Thanks in Advance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060504/33a17ad2/attachment.html
2009 Mar 29
2
after_create and after_save
Hi, AFAIK after_create is called after_save if the entry does not exist in the DB. Is there a way to tell if a specific model is new or not in after_save? I have to do something like: def after_save add_to_history ''save'' end def after_create add_to_history ''create'' end However after_save is called when creating too. -- cheers, M.
2006 Mar 02
2
url_for_file_column not returning correct path
I added this test towards the end of the included file_column_helper_test.rb that shipped with the file_column plugin: def test_url_for_file_column_different_root_path Entry.file_column :image, :root_path => File.join(RAILS_ROOT, "public/files") e = Entry.new(:image => upload(f("skanthak.png"))) assert_match %r{/public/files/entry/image},
2006 Jul 17
2
Very strange after_save problem. Please help.
I have a very strange problem here. I do not get this. So any help is greatly appreciated. Basically I have a model that calls a method in the background process in the "after_save" method. Let''s call the model products. So what happens is this: 1. I create a new product. 2. Everything works and the product is saved with id 13. 3. A method is called in my background
2010 Sep 27
7
Uploading photos
Hi all, Learning RoR (and loving it!) to develop a website. A requirement of the website is enabling users to upload photos to be made viewable (dynamically) on the website. Is this something I can develop with RoR? Thanks, Jeff -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2006 Jan 09
1
Saving an upload
I am creating a database for movies (films) and television shows (shows) that will have has_and_belongs_to_many relationships with the pictures table. CREATE TABLE screenshots ( id serial NOT NULL, filename character varying NOT NULL, content_type character varying NOT NULL, primary key (id) ); CREATE TABLE films ( id serial NOT NULL, name character varying NOT NULL,
2006 Jan 11
8
Oracle and Rails seems really slow.... In development
I''m just looking into how to connect to Oracle using Rails. I''ve got everything connecting and working as it should. I have a Users table in Oracle: create_table "users", :force => true do |t| t.column "username", :string t.column "created_on", :datetime t.column "email", :string t.column "note", :text
2006 Aug 15
8
AGAIN: file object treated as string
I am trying to implement the uploading of a file to a remote server I get error while trying to write the file on the server. The error I get is the following: undefined method `rewind'' for #<String:0x2aaaad062eb8> It seems to be treating my file as a string instead of a File object. --------- Code is below ------------------ VIEW: <%=