Welcome Guest | Login

can't open an XML file

Hi,

I try to open a file which name is 97.gpx located in my public/gpx_file/ directies of my app

I use this code :
    if file = File.new("#{RAILS_ROOT}/public/gpx_file/97.gpx") 
        @test ="toto"
   end
in return I've got this in my  production log file  :
    Errno::ENOENT (No such file or directory - public_html/gpx_file/97.gpx)
this code works on my work station.

The file exists and I can download it in my web app with this link:
   <a href="/gpx_file/97.gpx">
I tried this path to, and it doesn't work

Can somebody help me?



2007-11-03 04:01 PM

Try

   if file = File.new("public/gpx_file/97.gpx", "w")
        @test ="toto"
   end

or just

   if file = File.new("97.gpx", "w")
        @test ="toto"
   end

and test to make sure its not some other permissions problem.  You'll want to make sure public and gpx_file are chmod 755

2007-11-03 05:18 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!