-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it posible to upload images from a remote url? #52
Comments
You can:
|
This leads to security issue: I want only allow to upload files from remote URL, but this also allows local uploads (any file from |
@denispeplin How about adding a custom validation which filters only valid URLs like starting with Personally, I'm using a filter like this; defp apply_image_remote_url(attrs) do
case attrs["image_remote_url"] != nil && String.starts_with?(attrs["image_remote_url"], ["http://", "https://"]) do
true -> Map.put(attrs, "image", attrs["image_remote_url"])
false -> attrs
end
end I think it'd better to provide options in addition to allow_paths in the library. |
The Arc API docs show it being able to store an image from a web URL:
Is that posible with arc_ecto and if so could you give an example?
The text was updated successfully, but these errors were encountered: