Displaying 20 results from an estimated 300 matches similar to: "undefined method `original_filename' for "random.jpg":String"
2006 Jul 04
0
Uploading files - getting size
Hi,
I want to get the size of an uploaded file that is saved in the
database. Can you help me?
In the edit view formular there is:
<input id="attachment_title" name="attachment[title]" size="30"
type="text" /> <input id="attachment_attachment"
name="attachment[attachment]" size="30" type="file" />
2006 Jul 03
0
Multiple File Upload
Hello together,
I developed a file upload in my application like this (files uploaded
belong to a project):
project_controller.rb:
----------------------
def upload_attachment
project = Project.find(@params[:id])
begin
project.attachments.create(params[:attachment])
rescue
flash[:attachment_error] = "Error at Upload"
end
redirect_to :action => "edit_project", :id
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 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)
2006 Mar 06
1
Uploaded File to Database
Hi,
I currently write a tool for my school. Therefore I have to save
uploaded files.
I bought Agile Web Dev. with Rails to learn webdev with Rails.
I''m very new at rails and couln''d find anything on the internet.
Now when I want to save the file data to the mysql database, rails gives
me an error.
My code is the same as written in the book on page 363.
Here is my code of the
2006 Feb 05
0
validating presence of file uploads
not sure whats going on here, but I''m using some pretty standard code to
manage file uploads in to a db, but having trouble detecting if the file
upload field has been filled or not.
in my Asset Model, I have:
def asset=(asset_field)
self.name = base_part_of(asset_field.original_filename)
self.content_type = asset_field.content_type.chomp
self.data = asset_field.read
end
def
2013 Jun 28
1
version 2.3.3, file log.c bug report
Hello there,
I just ran the static analysis checker "cppcheck" over the source code
of icecast version 2.3.3
Amongst many other things, it said
[log.c:301]: (warning) Logical conjunction always evaluates to false: log_id < 0 && log_id>= 25.
Source code is
??? if (log_id < 0 && log_id>= LOG_MAXLOGS)
??????? return;
Suggest replace && with ||.
2001 Sep 27
2
Icecast2 in xiph CVS, PATCH!
Hi! Here are some patches to the CVS (ices) that I made to
get my radio webinterface with songselection-support
working.
To make the log update (flush) each time something is
written (before the patch it flushes only when you quit):
---- CUT ----
Index: log.c
============================================================
=======
RCS file: /usr/local/cvsroot/log/log.c,v
retrieving revision
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
2012 Nov 12
1
undefined method `original_filename' for nil:NilClass
Hi, although I saw this problem in other blogs, I couldn''t make it works.
My view:
*<%= semantic_form_for :routes_status_race, :url =>
status_race_admin_routes_path do |f| %>*
* <% contact_array = Contact.all.map {|contact| [contact.name,
contact.id]}%>*
* <% route_importer_array = RouteImporter.all.map {|importer|
[importer.name, importer.id]}%>*
* <%=
2010 Oct 25
0
Rails 3 -NoMethodError (undefined method `original_filename
Hello! I''m using Rails 3, Uploadify, to send images to S3.
Right now all the images being uploaded to S3 have the MIME:
application/octet-stream
I''d like to fix that but I''m getting the following error:
NoMethodError (undefined method `original_filename'' for
#<ActiveSupport::HashWithIndifferentAccess:0x107c81998>):
app/models/photo.rb:29:in
2006 Jul 18
0
ffmpeg and IO.popen
i?m fairly new to ruby...
any suggestions getting the below to work...
i?d like to use myfile_field.read within encodeVideo
and then self.data = Student_Interviews.flv
class Myfile < ActiveRecord::Base
.
.
.
def encodeVideo opts #, stream
IO.popen(?ffmpeg #{opts}?, ?w?)#{ |io| io.puts stream}
end
def myfile=(myfile_field)
if myfile_field and myfile_field.length > 0
encodeVideo ?-i
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
2005 Feb 20
0
ices2 not re-connecting on live stream
On Sun, Feb 20, 2005 at 08:15:42PM +0000, Karl Heyes wrote:
> setting <logsize> will cause an automatic log rotation when a certain
> file size has been reached. It renames <logfile> to <logfile>.1 then
> opens a new file <logfile>
Since all my other logs are rotated on a daily/weekly basis, I want my
ices logs to behave in the same way.
Nevertheless, this thread
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
2011 Apr 29
4
You don't check for malloc failure
Hi,
You don't check for malloc failure. I've made a patch that is possibly
wrong but it saves the program from SIGSEGV and replaces it with SIGABRT.
-peter
diff -ru icecast-2.3.2-ORIG/src/admin.c icecast-2.3.2/src/admin.c
--- icecast-2.3.2-ORIG/src/admin.c Fri May 2 17:40:00 2008
+++ icecast-2.3.2/src/admin.c Thu Apr 28 19:53:03 2011
@@ -291,6 +291,9 @@
2006 Feb 06
2
File_field and Firefox
Hi!
Im developing a simple prototype of an application. It fills an oracle
db with data about a file in the filesystem, and save the entire file
in a blob along with some metadata. To get the file in the db i use a
file_field form helper. All goes well with the radrails-integrated
browser, but it doesnt work anymore in firefox. The problem is,
firefox seems to cut the pathname from the file.
Here
2004 Aug 06
0
Problem with ices on OpenBSD 2.9 w/ Icecast 1.3.10
Not got to the bottom of it yet, but commenting out both LOG_INFO
lines in thread/thread.c stops it segfaulting. Now I'm back to the old problem
of a 128k stream not being sent fast enough to the clients.
Nick
----- Original Message -----
From: "Nick Ludlam" <nick@ivision.co.uk>
To: <icecast@xiph.org>
Sent: Monday, July 09, 2001 8:54 PM
Subject: [icecast] Problem with
2004 Aug 06
2
Problem with ices on OpenBSD 2.9 w/ Icecast 1.3.10
Hi,
got a little problem with the current cvs version of ices. I'm invoking it
with the following:
ices -v -F /home/nick/icetest.pls -h localhost -P <my password>
which seems to connect ok, get past password validation, and gives
me the following:
DEBUG: Sending following information to libshout:
DEBUG: Stream: 0
DEBUG: Host: localhost Port: 8000
DEBUG: Password: hack Icy Compat: 0
2006 Apr 01
3
Determine image width of png, gif or jpg?
Hi all
In PHP I have a neat function:
http://ch2.php.net/function.getimagesize
With it I can easily determine the dimensions of an image file. How can
I do that in RoR?
Thanks for help. Greets,
Josh
--
Posted via http://www.ruby-forum.com/.