similar to: How do I get an original file name from an upload using file_field?

Displaying 20 results from an estimated 600 matches similar to: "How do I get an original file name from an upload using file_field?"

2017 May 09
2
source(), parse(), and foreign UTF-8 characters
Hi I'm having trouble sourcing or parsing a UTF-8 file that contains characters that are not representable in the current locale ("foreign characters") on Windows. The source() function stops with an error, the parse() function reencodes all foreign characters using the <U+xxxx> notation. I have added a reproducible example below the message. This seems well within the
2005 Nov 17
1
original filename doesn't display in file_field
In my item upload view I have: <%= file_field ''item'', ''file'' %> and in my Item model: def file @file #@file.original_filename # <- also tried this end def file=(file) @file=file end And if the upload bails because of errors (and renders the same page), all other fields (text_field, text_area, etc.) retain their inputted values, but the file
2006 Jul 14
3
compare two tables and find the difference?
I need to compare a column in TableA to a column in TableB and then select 3 columns from TableA for all the records in TableA that don''t exist in TableB. TableA and TableB are different but do have one field in common that i am comparing. The tables are not related in anyway. right now I have a find_by_sql query located in a model that looks like this: def self.absent_charges
2008 Feb 09
0
a problem with before_create and validations
I stumble across some strange problem. I have a model with a virtual attribute file_contents that is a string. The model has validates_format_of :file_contents, :on => create, :unless => no_contents? (The method that returns file_contents.nil?) Then, I have a before_create callback, where I get my model''s title and description by parsing file_contents, and do write_attribute for
2017 May 09
0
source(), parse(), and foreign UTF-8 characters
On 09/05/2017 3:42 AM, Kirill M?ller wrote: > Hi > > > I'm having trouble sourcing or parsing a UTF-8 file that contains > characters that are not representable in the current locale ("foreign > characters") on Windows. The source() function stops with an error, the > parse() function reencodes all foreign characters using the <U+xxxx> > notation. I have
2006 Jan 22
1
file_field questions
A couple questions about file_field elements. First, with code such as this: <%= file_field ''attachments'', ''filename'' %> Would the filename of the file I select be the value that''s stored within the database under the "filename" column, and then I would just add in code in my "create" controller to upload the actual file?
2010 Sep 20
0
file_field
At: http://www.tutorialspoint.com/ruby-on-rails/rails-file-uploading.htm You can find: <%= file_field ''upload'', ''datafile'' %> I saw the file_field documentation from here: http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-file_field But, still cannot get how the parameters ''upload'' and
2006 Jan 15
4
file_field vs. file_field_tag
Hi, The documentation doesn''t make it clear why both file_field and file_field_tag are both useful. What is the reason for having two instead of just one of these? Thanks, Peter
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
2009 Feb 11
0
remote_form_for file_field strangeness
Does anyone see any problem with this form? - form_remote_for(Photo.new, :html => {:multipart => true, :target => :uploader}) do |f| .form_element = f.label :photo = f.file_field :collateral = hidden_field_tag :container_id, @shoot.id = hidden_field_tag :container_type, @shoot.class.name .form_element = f.submit ''Add Photos'' The photo has a
2006 Jul 18
0
how to ensure that a file has been selected on a file_field?
Does anyone know how to validate if a file has been selected using a file_field control? I want to ensure a file has been selected before the associated action is selected. Presumably something like validates_presence_of something ? Any pointers most appreciated... John -- Posted via http://www.ruby-forum.com/.
2006 Apr 30
0
ActionMAiler and file_field Question
Hi Gang, I''m trying to figure a way to set an attachment to an email by allowing the user to browse for a file to send with the mail. I thought that I could use file_field to do this - but having no luck. HAs anybody got a working example of how to achieve this? Or is it the wrong way to go? TIA, Eric.
2008 Jun 19
2
Non editable file_field
Hi, I need to upload files in my application I am using following code <tr> <td width="125">Upload Document:</td><td width="400"><%= form.file_field("filename") %></td> </tr> But I want that the file field that gets displayed in my browser should not be editable. i.e user should be able to select the file through the
2009 Oct 20
5
Annoying problem with file_field and paperclip
Hi all, I have a really really annoying problem that''s driving me nuts with file_field and paperclip and having to upload images everytime a form is edited even though the user is quite happy with the currently uploaded image or loose the previously uploaded image. This seems to be caused by the rails file_field helper not storing the data that has been read in from the db in the same
2006 Dec 15
0
Help with file_field
I''m new to ruby and rails, so sorry if this is a simple question. I''ve found lots of examples that demonstrate uploading pictures, but I need something simpler. Could someone post a simple example of uploading a text file, saving the file in an object and then "puts" the object text. I''m really getting lost in two steps: 1. How to get from file name to
2011 Apr 29
3
running libguestfs as a service?
Hello, First off, many thanks for libguestfs... very useful! I'm trying to run libguestfs as an RPC service by using a python daemon with the python libguestfs bindings. With this service I'm "centrally" editing VM images, and often running many GuestFS() on the same image file in a short amount of time to edit the image's contents. The problem I'm running across is
2017 May 09
1
source(), parse(), and foreign UTF-8 characters
On 09.05.2017 13:19, Duncan Murdoch wrote: > On 09/05/2017 3:42 AM, Kirill M?ller wrote: >> Hi >> >> >> I'm having trouble sourcing or parsing a UTF-8 file that contains >> characters that are not representable in the current locale ("foreign >> characters") on Windows. The source() function stops with an error, the >> parse() function
2007 Mar 14
9
file_field doesnt work inside form_remote_for
When I do file_field within a form_for things are fine... but within a form_remote_for, with nothing else changed, I find that the params does not even have the element document[uploaded_file] even though it is definitely present in the HTML source in the form. Obviously the file upload fails. Am I missing something? Or has someone else faced this? Or is this a known bug? Rajesh
2006 Jul 17
0
collection_select help
I can''t figure out how to get the collection_select to correctly identify and select the appropriate option in the drop down to begin with. i have checked that charge.offense_level contains the correct value to begin with (a number between 1 and 10) but the view still defaults to the first option and not the one contained in the charge.offense_level. what am i doing wrong? any
2013 Jul 19
2
puppet master and fileserver separate problem
my environment: 192.168.0.13 puppet.uc.local 192.168.0.14 puppetca.uc.local 192.168.0.15 report.uc.local 192.168.0.16 fileserver.uc.local 192.168.0.17 agent01.uc.local i want run a master as fileserver (fileserver.uc.local) the puppet.uc.local and fileserver.uc.local use one ca.pem on puppet.uc.local, i wrote a class for test class test { notify { "hello