arc icon indicating copy to clipboard operation
arc copied to clipboard

add request_dir for allowing the url to be different then that of the storage path.

Open joshchernoff opened this issue 7 years ago • 8 comments

This is for allowing the url to be different then that of the storage path.

joshchernoff avatar May 17 '17 20:05 joshchernoff

The point of this was to allow me to set the storage path differently for my uploader via

  # Override the storage directory:
  def storage_dir(version, {file, scope}) do
    "priv/uploads/photos"
  end

  def request_dir(version, {file, scope}) do
    "uploads/photos"
  end

This allowed me to use plug static via

  plug Plug.Static,
    at: "/uploads/photos", from: {:digitalcakes, "priv/uploads/photos"}, gzip: false

request_dir defaults to storage_dir

joshchernoff avatar May 17 '17 20:05 joshchernoff

ouch, welp it was worth a try... I guess.

joshchernoff avatar Nov 22 '17 18:11 joshchernoff

Is it there any chance that this PR would be merged?

I basically reimplemented the same feature in my app. (+ asset_host for local storage). Should I create new PR with my changes too?

scarfacedeb avatar Feb 16 '18 12:02 scarfacedeb

@scarfacedeb I hope so too. I can see we still need a spec to test the behavior. I might get around to writing that later this evening, but have some things at work to deal with first.

If you have something to contribute to whats already here, have a different / better implementation, or you would like to write the above mentioned spec, it would be very appreciated. If you want to contribute to whats already here, i think you can just base your commits on this PR, and make a new PR that includes cakes commits.

pedep avatar Feb 16 '18 17:02 pedep

Hello so sorry for the long reply. I will see if I can make sometime this week to update the pr. Thanks for the review.

joshchernoff avatar Mar 05 '18 18:03 joshchernoff

@digitalcake No problem :smile: Your work is appreciated

pedep avatar Mar 05 '18 18:03 pedep

Why is this not merged yet? This is a problem I'm facing for a long time now. 7 months have passed and nothing happened so far.

Would you be please so kind and merge this?

szabolcsmaj avatar Sep 28 '18 11:09 szabolcsmaj

Sorry I've foolishly have deleted my local repo for this while cleaning up my account. I've also found using ExAws.S3.presigned_url a much more useful case for uploading files via the client and don't think I will be trying to use Arc in the future so sorry to say I'm gonna pass on this.

I'll keep this open for anyone who wishes to try and finish what I started.

joshchernoff avatar Oct 06 '18 17:10 joshchernoff