[OSM-dev] Re: [OSM-talk] Problem uploading

Ben Gimpert ben at somethingmodern.com
Thu Mar 30 10:21:35 BST 2006


Maybe Ruby and/or "cgi.rb" has been changed?  I just know that when I
deal with Ruby and "multipart/form-data" forms, the CGI class wraps
uploaded files in the CGI faux-hash as an object that needs to be read:

>From another app I work on:

$cgi = CGI.new("html4")
params = {}
$cgi.each do |param|
  key = param.first
  value = $cgi[key]
  if value.respond_to?(:read)
    params[key] = $cgi[key].read
  else
    params[key] = value.to_s
  end
  params[key].untaint  # gulp
end


On Wed, Mar 29, 2006 at 10:50:04PM +0000, SteveC wrote:
> Hi Dan
> 
> I'm totally baffled. I can tell you whats not working, but not why.
> 
> Line 45 of upload-gpx.rb says
> 
> tmpfile = cgi.params['gpxfile'].first.path.
> 
> what this does is get the filename of where the uploaded file is on the
> sever (apache copies it to a random place with a funny name), so it's
> independent of the actual file itself. It's nil, the same as null in
> other languages. Error logs show nothing.
> 
> But, other files upload fine and there is lots of disk space available
> and the filename itself I changed when I tried to upload it. So it has
> to be the contents. Somehow. Maybe something like the encoding or the
> wrong type of line endings. It really shouldn't be though.
> 
> I'm copying to the dev list. If you could upload it somewhere for other
> people to look at then we might pin it down.
> 
> Sorry!
> 
> * @ 29/03/06 10:27:30 PM dan at karran.net wrote:
> > Steve,
> > 
> > Just to give a little more troubleshooting info... I've tried the same
> > file a few times, and it won't work, but I've also managed to
> > successfully re-upload a file from yesterday.
> > 
> > The only difference I can spot is that the previous files have had
> > more than one ACTIVE LOG, whilst this one only has a single one.
> > 
> > 
> > Cheers,
> > Dan
> > 
> > On 3/29/06, Dan Karran <dan at karran.net> wrote:
> > > Hi Steve,
> > >
> > > Just checked inside the file and it looks like a normal GPX. Here it
> > > is anyway, in case you can see anything weird with it.
> > >
> > >
> > > Cheers,
> > > Dan
> > >
> > > On 3/29/06, SteveC <steve at asklater.com> wrote:
> > > > * @ 29/03/06 05:08:52 PM dan at karran.net wrote:
> > > > > Is there an issue uploading files at the moment? When I try to upload
> > > > > a small file, I get the message 'Something went wrong scheduling that
> > > > > file. See the wiki / mailing list for help.'
> > > >
> > > > No.. but someone is hitting the database pretty hard.
> > > >
> > > > Can I have a copy of the file to debug?
> > > >
> > > > have fun,
> > > >
> > > > SteveC steve at asklater.com http://www.asklater.com/steve/
> > > >
> > >
> > >
> > > --
> > > Dan Karran
> > > dan at karran.net
> > > +49 178 562 2321
> > > www.dankarran.com
> > >
> > >
> > >
> > 
> > 
> > --
> > Dan Karran
> > dan at karran.net
> > +49 178 562 2321
> > www.dankarran.com
> 
> have fun,
> 
> SteveC steve at asklater.com http://www.asklater.com/steve/
> 
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev




More information about the dev mailing list