I'm using acts_as_attachment to do user avatar image uploads and it
works fine.  I haven't tried to code it directly.  Depending on what
you're trying to accomplish, that might help out.

On Apr 3, 4:50 pm, SimianLogic <[EMAIL PROTECTED]> wrote:
> 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