Skip to content
Discussion options

You must be logged in to vote

I found a solution that works, after realising that I do something similar elsewhere in my app:

After extracting the file manually into the cache area, I can then create an UploadedFile object and attach that, which then cleans up nicely after itself.

files.create(filename: filename, attachment: ModelFileUploader.uploaded_file(
  storage: :cache,
  id: File.join(file_path_inside_cache),
  metadata: {filename: File.basename(file_path_inside_cache)}
))

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@Floppy
Comment options

@Floppy
Comment options

Answer selected by Floppy
Comment options

You must be logged in to vote
1 reply
@Floppy
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants