Does anyone have user uploads working in their app? Whenever I try to
make a directory with dir.mkidr, I get an error: "no such file or
directory"  This seems a little counterintuitive... I know the
directory doesn't exist--that's the reason I'm making it!

After creating the directory by hand and trying to upload again,
everything seems to work fine.  Only the image isn't actually written
to the disk...

Here's my file writing code:

        File::delete(RAILS_ROOT + fname) if File::exist?(RAILS_ROOT +
fname)

        File::open(RAILS_ROOT + fname, 'w') { |f|
          s = user[:image_data].respond_to?(:read) ?
user[:image_data].read : user[:image_data]
          f.write(s)
          RAILS_DEFAULT_LOGGER.info("Writing file...")
        }

Where fname is something like "/images/user/0000/user_id"
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to