forked from stavro/arc_ecto
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
allow passing binary data structs as attachments
arc allows storing `%{filename: filename, binary: data}`, and now arc_ecto allows these structs to be accepted in `cast_attachments` fixes stavro#54
- Loading branch information
Showing
2 changed files
with
10 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9c6c9d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azhi can you provide an image test insteadof <<1,2,3>> ?
I am able to write to a file but the result is my image file cannot be opened by a regular image reading program.
9c6c9d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quantumproducer this fork is used for uploading image files, and it seems to be working fine. Most likely your issue is related to the way you retrieve your image file, or to arc itself.
I would suggest retrieving image files from all possible steps inside your system (e.g. one file retrieved manually to serve as a reference, one file retrieved through elixir client, ..., one file that was uploaded through arc) and comparing them with
diff
to find where alteration occurred.9c6c9d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azhi Thanks for the quick response. Manually reading from the uploads/ folder by my OS fails, which tells me that the write to disk didn't save the image correctly. I tried the sample code from the arc_ecto issue:
and when it saves to my hard disk, I cannot open the image.