Displaying 20 results from an estimated 23 matches for "path_to_file".
2006 Jun 04
4
Fil from filsystem -> db
...emoting
made easy" (http://sean.treadway.info/). I''m saving a file to the
filesystem, and then trying to put it in to the database when I do the
final submit with ajax. I thought picking the file up and putting it
in the db would be as easy as having:
"@image.data = IO.read("path_to_file") in the create method in the
controller. But I get: "undefined method `read'' for #"
What''s the right way of doing this?
- Henrik
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 Sep 05
2
Mongrel and umask for uploaded files
...;ve also tried putting "File.umask(022)'' inside
environment.rb but that doesn''t make a difference.
To handle uploads, I have a resource model which does the following in
the before_create filter:
def before_create
return FileUtils.copy( @uploaded_file.local_path,
self.path_to_file) if @uploaded_file.instance_of?(Tempfile)
# else
File.open(self.path_to_file, "w") { |f| f.write(@uploaded_file.read) }
end
If anyone has any other hints for how to change the umask, please let
me know, this is driving me crazy! Thanks,
Mike
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/.
2008 Sep 25
0
Problem reading excel sheets
...ld you please help me with the code and how to use this gem? Is
> there any better way to read excel sheets.
>
> Snippet of Code:
>
> require ''rubygems''
> require_gem ''parseexcel''
>
> class Exams < ActiveRecord::Base
>
>
>
> path_to_file = ''C:\canvass\app\view\main\test.xls''
> workbook = Spreadsheet::ParseExcel.parse(path_to_file)
>
> # usually, you want the first worksheet:
> worksheet = workbook.worksheet(0)
>
>
> Also I am facing the error - '' uninitialized constant Spreadsheet'...
2010 Jun 22
2
domU can not start in Xen 4.0.1-rc3-pre using tapdisk
The domU is using pygrub to boot its own 2.6.18.8-xen kernel. It can be
booted successfully under 2.6.18.8-xen dom0 and xen 3.3.1.
However when upgrade dom0 to 2.6.32.15 and xen 4.0.1-rc3-pre, the domU can
not boot with tapdisk. I am wondering it is something related to the blktap
driver.
*When using tap:aio:* PATH/disk.img in domU disk configuration, the boot
process hanged at a prompt:
XENBUS:
2010 Jun 22
2
domU can not start in Xen 4.0.1-rc3-pre using tapdisk
The domU is using pygrub to boot its own 2.6.18.8-xen kernel. It can be
booted successfully under 2.6.18.8-xen dom0 and xen 3.3.1.
However when upgrade dom0 to 2.6.32.15 and xen 4.0.1-rc3-pre, the domU can
not boot with tapdisk. I am wondering it is something related to the blktap
driver.
*When using tap:aio:* PATH/disk.img in domU disk configuration, the boot
process hanged at a prompt:
XENBUS:
2018 Apr 23
0
Reconstructing files from shards
From some old May 2017 email. I asked the following:
"From the docs, I see you can identify the shards by the GFID
# getfattr -d -m. -e hex/path_to_file/
# ls /bricks/*/.shard -lh | grep /GFID
Is there a gluster tool/script that will recreate the file?
or can you just sort them sort them properly and then simply cat/copy+
them back together?
cat shardGFID.1 .. shardGFID.X > thefile "
/
The response from RedHat was:
"Yes, this sh...
2006 Apr 26
2
Routing to a static HTML file under RAILS_ROOT
I have a regular plain old static HTML file under my RAILS_ROOT that I
would like to serve as itself (without any dynamic anything).
How can I write a route to "pass the request through" succesfully.
I tried
map.connect ''path_to_file'', :controller => nil, :action => nil, :id =>
nil
but that didn''t work.
Also, note that I have this route already configured:
map.connect '''', :controller => "eSimply"
so I''m thinking that maybe that picks up everything?
Thank...
2012 May 31
2
send_data/send_file does not open a save as dialog box
Hello,
We are using JRuby 1.5.1/ruby 1.8.7/Rails 2.3.8 with a GWT front end.
I''m having an issue when attempting to send a server side .csv file to
the user using rails send_file.
my code is:
send_file(path_to_file, type=>''text/csv'')
While this is returning fine with an http status of 200, the client
side save as dialog is never opening for the user to receive the file.
Any ideas why this isn''t working?
--
You received this message because you are subscribed to the Google Gr...
2003 Feb 06
2
.Rprofile, .Rfirst, and .Rdata
Hi all,
After a short hiatus away from R I have found that it's changed a bit.
I used to keep a definition of .First in .Rprofile that did a couple of
things on startup (load a couple of libraries). Now, I've discovered
that when I change the definition of .First in .Rprofile it doesn't
change anything when I start up, because .First is held over in .Rdata
from the last session.
2001 Oct 04
3
printing out tables to a file using cat...
Hi, all. I'd like to print out a table to a file (I'm using
cat(...,file="foobar")). the problem is, cat doesn't print out the
headings for the table (making the table hard to interpret!). For
example:
> table(showdistribution(nw.109.transitions, interruptions[1]))
interruption opened-map
1 2
>
2008 Aug 01
2
BackupPC 3.1.0 on CentOS 5.2 triggers SE Linux denial
Hi. I've installed BackupPC 3.1.0 from Testing repository, to Cent
OS 5.2 x86_64, and I am hitting an SE Linux denial - the httpd cannot
talk to the BackupPC socket:
type=AVC msg=audit(07/31/2008 17:18:53.623:410) : avc: denied {
connectto } for pid=11767 comm=httpd
path=/var/log/BackupPC/BackupPC.sock
scontext=user_u:system_r:httpd_t:s0
tcontext=user_u:system_r:initrc_t:s0
2009 Mar 11
0
problem scrapping ATnT site (Matt White)
...radio button
>
> download_format_form = page_download.forms[3]
> download_format_form.radiobuttons[1].click
>
> # click on the submit link that downloads the csv file.
>
> download_file = agent.click download_page.search("a")[41]
> download_file.save_as("<path_to_file>.csv")
>
> The problem I am facing in the above code is:
>
> + Doesn''t do anything special after selecting a particular bill period from
> the select options.
> + Download the page source in stead of downloading the actual csv file.
>
> Can you suggest somet...
2012 Mar 28
3
scanning data into r
Hey
I am having trouble importing data into R, my data field looks like this
21 TEST DATA
32 year:2012
33
34
5
36
I require the the number at the start of each line however the text is not
needed, i am struggling to get R to import the data with out changing the
file itself?
how do i import the data, i have tried using comment.char=" ", however this
didnt work, any help would be
2010 Aug 12
2
tar - ssh - standard out
Hi
I have a process that creates 'some data' and outputs this to standard
out and i want to shift this data over ssh to a remote box without
ever writing anything locally. I have been experimenting with tar to
create the archive as the i dont know what the contents of 'some data'
might be so i just need to capture it and output it on the other side.
I have been trying with
$ tar
2009 May 23
10
Crash DomU and after it Dom0 is frozen.
Hello!
I installed NexentaOS (Opensolaris kernel b104+).
First booting system is true. Before first rebooting system updates
boot_archive. It''s false.
Computer is freeze and CapsLock and ScrollLock is blinking.
Helps only RESET button.
My system is Ubuntu 8.10, kernel-2.6.30-rc3-tip, Xen-3.4-Stable with debug
options enabled.
My hardware: AMD Athlon64X2 5400+, RAM 4GB.
For DomU: mem=1024,
2012 Dec 26
2
Problem with large/small numbers in knitr
I have problems with very large numbers using knitr. In the following, my a
and b are extremely small and ssrr and ssru are extremely large. Knitr
delivers error messages. Scaling ssrr and ssru by 1000 resolved the problem:
ssrr <-ssrr/1000 ; ssru<-ssru/1000
Any clue as to how I might resolve the problem?
BTW, the same program does run in another computer. I am wondering whether
my
2010 Dec 21
4
tap2:remus:backup_ip:9000|aio:/path_to_disk.img not working - OSError: [Errno 2] No such file or directory
Hello,
I''m using Xen (installed from source - "hg clone
http://xenbits.xen.org/xen-4.0-testing.hg") on Debian Lenny. Dom0 kernel is
2.6.32-bpo.5-xen-686.
Until now I have successfully ran the Lucid Ubuntu as domU guest, defining
disks as (and also as file:):
disk = [''tap2:aio:/home/xen/domains/lucid/disk.img,xvda1,w'',
2018 Apr 20
7
Reconstructing files from shards
Hello,
So I have a volume on a gluster install (3.12.5) on which sharding was enabled at some point recently. (Don't know how it happened, it may have been an accidental run of an old script.) So it has been happily sharding behind our backs and it shouldn't have.
I'd like to turn sharding off and reverse the files back to normal. Some of these are sparse files, so I need to account