Skip to content
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

(UndefinedFunctionError) function ExAws.S3.Upload.stream_file/1 is undefined (module ExAws.S3.Upload is not available) #70

Open
aliabbas-2012 opened this issue Apr 7, 2017 · 1 comment

Comments

@aliabbas-2012
Copy link

aliabbas-2012 commented Apr 7, 2017

Here is my output


{"image" => %Plug.Upload{content_type: "image/jpeg",
   filename: "17409815_1317417211684158_788963503_n.jpg",
   path: "/tmp/plug-1491/multipart-576910-531644-1"}}
[error] Task #PID<0.922.0> started from #PID<0.917.0> terminating
** (UndefinedFunctionError) function ExAws.S3.Upload.stream_file/1 is undefined (module ExAws.S3.Upload is not available)
    ExAws.S3.Upload.stream_file("/tmp/plug-1491/multipart-576910-531644-1")
    lib/arc/storage/s3.ex:55: Arc.Storage.S3.do_put/3
    (elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Function: #Function<0.52315234/0 in Arc.Actions.Store.async_put_version/3>

Here is my code

defmodule BlogTest.Avatar do
  use Arc.Definition
  use Arc.Ecto.Definition



  @versions [:original]



  def filename(version, {_file, scope}) do
    "{scope.uuid}_#{version}"
  end
  
  # Override the storage directory:
  def storage_dir(version, {file, _scope}) do
    "uploads/user/avatars/#{5}"
  end


end

@aliabbas-2012
Copy link
Author

I found solution by adding
def __storage, do: Arc.Storage.Local

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant