similar to: Upload File

Displaying 20 results from an estimated 200 matches similar to: "Upload File"

2006 Jul 31
2
The error occured while evaluating nil.gsub!
#{RAILS_ROOT}/app/controllers/start_controller.rb:13:in `create'' --- class StartController < ApplicationController def create #------------Remove Tag--------------------------- @name = params[:name] @file = params[:filepath] @file = @file.gsub!(/^.*(\\|\/)/, '''') # replace html tags with blank post = Post.save(@params["removetag"]) end end --
2006 Aug 02
1
Browse data from database
Hi all! I want to know how we can browse all data in the database and list it in the browser? Thanks in advance -- Posted via http://www.ruby-forum.com/.
2006 Feb 19
2
Prototype Ajax + File Uploading-- How?
Good evening! I''m currently trying to submit some data and a file upload through Ajax. I''m using rails & prototype, and somewhere there''s a disconnect. I''m reasonably convinced the file upload isnt being sent at all, or if it is, Rails has absolutely no idea. The form itself heads with: <form onsubmit="new
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 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
2011 Mar 26
2
upload file, read first 10 lines.
I have a csv file and in my controller: uploaded_file = params[:upload][:csv].read @rows << FasterCSV.parse(uploaded_file) I want to put in @rows only the first 10 lines but the read method reads all the file. How can I do? -- 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
2007 May 16
1
Rails, Mongrel and Rmagick
i have a rails app with a form that allows uploading an image file. I take the image file and read it into rmagick to verify that it''s an image. For some reason I can''t catch an exception thrown by rmagick inside the app. After an invalid image file is uploaded the process just hangs. I have to kill mongrel and restart to use the app again. img =
2006 Sep 05
2
Mongrel and umask for uploaded files
So any files that are uploaded through my form are getting the following mode: -rw------- I need them to have: -rw-r--r-- I''ve tried setting the umask in a script file called set_umask.rb as follows: File.umask(022) and then starting mongrel using: mongrel_rails start -m config/mime.types -S set_umask.rb but it doesn''t seem to change the mode that the files are created
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: <%=
2006 May 29
3
IFRAME based RJS - responds_to_parent
** File uploads with AJAX mojo ** Respond with RJS to your parent window with a form action targeted to a hidden IFRAME. Handles all the painful situations like scoping your JavaScript to your parent window generating the script block for execution and clearing the IFRAME after execution so the back button doesn''t re-execute the action. `plugin install
2006 Feb 17
1
validate() with has_many association
I''m creating a simple portfolio site for a painter. I have a painting and an image model with following relationship: Painting has_many :images Image belongs_to :painting On the edit screen the user can edit the Painting data as well as upload pictures for a thumbnails and full size image. The Image model extracts filename, width, and height from the uploaded file, saves those
2006 Feb 04
0
form_tag_with_upload_progress
hi all! i have a PictureController with an upload action: class PictureController < ApplicationController . . . upload_status_for :upload . . . def upload if params[:picture] @message = "File uploaded: " + params[:picture][:file].size.to_s picture = Picture.save(params[:picture]) session.update finish_upload_status "''#{@message}''" end
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 Jun 08
1
Permissions on uploaded files, TinyFile
Hi, im getting a little trouble with this, im using TinyFile as the example to upload files http://wiki.rubyonrails.com/rails/pages/TinyFile/versions/20 All goes well but the files uploaded are saved with permissions 600 (linux) and in the case of images arent showed on the browser(but uploaded and stored in the server without problems) i have to manually ftp to the uploaded files folder and
2006 May 01
10
large file storing in postgres sucks?
Hi, I''m not sure if this is a postgres issue or not, but I''m using Postgres 8.1. I have (in my functional tests) the following code: upload = fixture_file_upload(''/files/podcast.mp3'', ''audio/mpeg'') post :create, :product => valid_product, :media => { :image => upload } And then in the controller: blob = Blob.create :data
2006 Jun 09
8
[how can i delete a file system..please help]
Hi, I''m trying to delete a file system (<xml_26548975.xml>) File.delete("xml_26548975.xml") But I get this error: "Permission denied - ./script/../config/../uploads/xml_26548975.xml". Why? -- Cheers, ioana k&a http://boulangerie.wordpress.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL:
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/.
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
2006 Dec 30
2
Another RSpec on Rails issue: how to test send_file()
Hi! Today I needed to implement some controller code, that uses send_file() to send image data. How can this be tested / specified with RSpec? bye, Tobias
2006 May 19
9
Resize uploaded image file without creating temp file?
Hi, I need to take a single uploaded image file and save three resized versions of it, a thumbnail, normal and large version. I was planning on doing this in my model by having an array of geometry strings and looping through them, each time saving a new image object resized to the correct geometry. I know that file column does similar stuff, but I would prefer to have a separate database row