You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's the point of the cast_attatchements helper? I want to be able to do some stuff with the file in my changeset. Right now, purely by having my schema as field :picture, Pykture.PictureUploader.Type, it causes the changeset the process the upload to S3, and covert my :changes field in my changeset to a %{file_name: "name.jpg", updated_at: XXX}. I would have have params like: %{picture: "/some/path/name.jpg"}. I want to be able to use /some/path/name.jpg BEFORE I decide the upload the process my file, I thought that was what cast_attatchements did, and I could therefore process/upload my file at a later point in my changeset sequence. Is there anyway to do this? Right now there seems to be no difference between having cast_attatchements and not having it. Either way, my changeset will immediately upload/process my file, and convert the file to use the customize map.
The text was updated successfully, but these errors were encountered:
I believe this is pretty much not directly related to the arc_ecto. Handling uploads with directly with Plug.Upload will give the desired flexibility to manipulate resources before pushing them to S3.
@pejrich if you want custom paths, you need to work on your uploader file and override storage_dir function. Unfortunately you can't use the model's id because it's not available when you create a new record (except the case you're adding a file after the record is already created).
If you need to apply some algorithm to generate the desired path, then you have to work on the changeset beforecast_attachments is called.
What's the point of the
cast_attatchements
helper? I want to be able to do some stuff with the file in my changeset. Right now, purely by having my schema asfield :picture, Pykture.PictureUploader.Type
, it causes the changeset the process the upload to S3, and covert my:changes
field in my changeset to a%{file_name: "name.jpg", updated_at: XXX}
. I would have have params like:%{picture: "/some/path/name.jpg"}
. I want to be able to use/some/path/name.jpg
BEFORE I decide the upload the process my file, I thought that was whatcast_attatchements
did, and I could therefore process/upload my file at a later point in my changeset sequence. Is there anyway to do this? Right now there seems to be no difference between havingcast_attatchements
and not having it. Either way, my changeset will immediately upload/process my file, and convert the file to use the customize map.The text was updated successfully, but these errors were encountered: