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
Is it possible to add an option to store the image based on an external URL, filename and scope? Def.store(%{filename: '....', path: 'blob:http://localhost:4000/sdfsfsfd.jpg'}, my_scope)
Currently even though there's a pattern match to accept this, it doesn't work because it uses File.exists? to check if the file is temp stored in Phoenix. Which this file isn't, so this returns an error, even though the URL is technically still valid:
def new(%{filename: filename, path: path}) do
case File.exists?(path) do
true -> %Arc.File{path: path, file_name: filename}
false -> {:error, :invalid_file_path}
end
end
I'd love to have support for storing images based on external source URL and a filename. This would be a huge convenience because users will no longer need to send FormData in order to generate the Plug.Upload struct.
PS. Thanks for the amazing library!
The text was updated successfully, but these errors were encountered:
@stavro
Is it possible to add an option to store the image based on an external URL, filename and scope?
Def.store(%{filename: '....', path: 'blob:http://localhost:4000/sdfsfsfd.jpg'}, my_scope)
Currently even though there's a pattern match to accept this, it doesn't work because it uses
File.exists?
to check if the file is temp stored in Phoenix. Which this file isn't, so this returns an error, even though the URL is technically still valid:I'd love to have support for storing images based on external source URL and a filename. This would be a huge convenience because users will no longer need to send
FormData
in order to generate thePlug.Upload
struct.PS. Thanks for the amazing library!
The text was updated successfully, but these errors were encountered: