similar to: Ouch! Can't figure out this file upload issue...

Displaying 20 results from an estimated 7000 matches similar to: "Ouch! Can't figure out this file upload issue..."

2006 Aug 01
3
Upload file to file system and sql insert date errors
I''m trying to use one form to upload a file to the file system and insert a title and description field into the database. I have no problem uploading files to the file system using the code from http://wiki.rubyonrails.com/rails/pages/HowtoUploadFiles There are more fields on the form than need to be inserted into the database, name and file. I need to pull out these extra fields
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 May 29
3
File.size() on Uploaded Images Fail
I am checking the file size of an uploaded file and storing it in a filesize column. It will work just fine when the user uploads any files other than images (jpg,png,gif). Word, Excel, Powerpoint, .zip and more all work fine. This is my model asset.rb that handles the file upload. def newfile=(newfile_field) self.filename = base_part_of(newfile_field.original_filename) self.filetype
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 Jan 05
4
testing file uploads
Hi all, I was wondering about the class used when rails receives file uploads. Sometimes it appears to be a File, and other times it is a StringIO. Also it has methods such as original_filename that don''t appear to belong to either of these classes. I ask because I''m trying to work out how to test my fil upload related models and controllers. Is there some standardised way of
2011 Nov 02
4
undefined method `updated_at' for #<Classified:0x686c5e4>
HEllo, I have the following problem with rails, I am new in this...is there anyone who explain to me what´s happens? Thanks See below: NoMethodError in Classified#show Showing app/views/classified/show.rhtml where line #17 raised: undefined method `updated_at'' for #<Classified:0x686c5e4> Extracted source (around line #17): 14: 15: <strong>Date Posted:</strong>
2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
I submitted this earlier, but the web forums went down and I''ve screwed up the thread, so I''m starting over. I''m trying to built a document upload system. The system has a main Document model with different subclasses for different types of documents. With the code below, if I attempt to create a Document, it works fine, but if I attempt to use one of the subclasses, I
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,
2007 Aug 03
6
Problems saving an uploaded image to an app folder
In my app, the user can upload images. Rather than shoving the image data in the database, i want to put the filename and content type into the db, then rename the image with its record''s id number, and then save it into a local folder in my app folder. (hardcoded for now) All the details are being saved to the db ok, so as far as i know the "picture_file=" method is fine.
2006 Jul 07
3
quick send_data question...
Hi, I am using send_data to allow users to download files from the database but ran into a small problem, it seems that files upload fine but when they download only 64kb of the file is sent. I''m using the basic rails code from the Agile book: #upload code in my sheet model def file=(document_field) self.filename = base_part_of(document_field.original_filename)
2008 Sep 02
2
Actionmailer - Multipart and Outlook?
Hi, I''m having issues with getting a consistent result with the emails I am sending using Actionmailer. Problem: Emails that I send with plain text, rich text, and attachments do not display the same results across GMail, Yahoo, Outlook and Thunderbird. Scenario: I am sending an email with text/plain, text/html, and 2 attachments using the code below, and I''ve specified the
2007 Mar 11
4
Faking it... import local files into attachment_fu
Hello, I''m working on an import utility that will match the functionality of uploading an object of a model that uses attachment_fu for thumbnailing, etc. Rather than uploading the file via a form, I want to populate the params[:image][:uploaded_data] with data from a file already on the server''s file system. So far, I''ve been able to copy to an instance of Tempfile
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
2008 Oct 08
11
Using image_tag and send_data
I am using image_tag to load an image that I''ve saved to the database (using attachment_fu if you''re curious but that''s probably not relevant here): VIEW <%= image_tag ''/photo/get_image/5'' %> CONTROLLER def get_image @photo=Photo.find(params[:id]) send_data(DbFile.find(@photo.db_file_id).data, :type =>
2008 Jul 04
9
file upload
is there any link for step by step guide in file upload in database ... im follwing the link http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm.. which shows file upload into folder not in database ..pls help.. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2007 Dec 11
14
Attachment-fu + Story Runner
Hi all, I''m trying to run a Story Runner integration test that uploads a file through Attachment-fu. I''ve tried various ways of specifying the file data, from custom mocks: class MockFile < Struct.new (:original_filename, :read, :content_type); end fdata = MockFile.new "test_upload.txt", "Test Upload", "text/plain" to
2007 Aug 22
8
How to spec an attachment_fu model
First off, I''m not trying to spec attachment_fu, I know it''s been tested. But, I added some code to that model that I do need to test. Basically, I need to somehow fulfill the "uploaded_data" property so I can actually run my tests(otherwise they fail because of validations). The "uploaded_data" field is what would grab the multipart data from form. Here
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
2006 Mar 29
7
Uploading files and writing them to server?
Where should I look for information on how to use Rails and Ruby to accept the upload of a file and then to save that file to the file system of my server? I''m reading the "Uploading a file" section of Agile Web Dev with Rails, but it''s geared toward saving the file in the database. Any advice? Thanks, Jeff -- Posted via http://www.ruby-forum.com/.
2009 Jun 17
1
File UPLOAD and put it on a DB BLOB
@contact = Contact.new @contact.file_file_name=params[:contact][:file].original_filename @contact.file_content_type=params[:contact][:file].content_type.chomp @contact.file=params[:contact][:file].read @contact.save the first two elements work, @contact.file=params[:contact][:file].read results empty, can you say me where I am wrong. Sergio