spree-contrib / spree_digital

A Spree extension to enable downloadable products
http://spreecommerce.org
MIT License
117 stars 97 forks source link

Create other resource url logic #71

Closed camelmasa closed 3 years ago

camelmasa commented 10 years ago

I create logic for deliver other resource url. We need this logic when deliver digital item from customer server.

camelmasa commented 10 years ago

Test failed... but this PR's test success. Edge spree's tests failed :(

If possible, please review this PR @JDutil

Thanks.

halo commented 10 years ago

I like the idea in general. This might also be a solution for these folks: https://github.com/halo/spree_digital/issues/56

How do you set the resource_url?

camelmasa commented 10 years ago

Thanks.

well... we can't configure resource_url :expressionless: you are right. We need to create forms for resource_url on admin so I'll add commits to this PR.

halo commented 9 years ago

@camelmasa Any news? :) The code has diverged, but at least specs in master are passing again.

camelmasa commented 9 years ago

@halo Thank you for mention :+1: The repository was move to spree-contrib. It's nice :smile: I'll rebase the branch and I'll add form for input resource_url.

camelmasa commented 9 years ago

@halo I changed some points on admin page. Please check it.

spree_administration__ _broken_file___warning__this_file_is_broken____current_file___current_file____delete_file___delete_this_file____delete_file_confirmation___are_you_sure_you_want_to_delete_the_file__ filename _____digitals___digitals__

halo commented 9 years ago

We need this logic when deliver digital item from customer server.

@camelmasa How exactly do you mean? So people buy a product and then they get the secret link and can download it an infinite number of times and share the link with others? What do you mean by "customer server"? :)

camelmasa commented 9 years ago

@halo we are providing EC pratform service. so I meant the "customer" is "store owner".

So people buy a product and then they get the secret link and can download it an infinite number of times and share the link with others?

Yes... :( I need to fix it from "redirect URL" to "forward file".

halo commented 9 years ago

we are providing EC pratform service

Ah! That makes sense.

I need to fix it from "redirect" to "forward".

Hm. I can only imagine that you'd download the file first and then send it out. But that would not really work for big files.

Do you have an idea how you would like to do this? Something like this?

camelmasa commented 9 years ago

@halo Thank you for response :wink:

Hm. I can only imagine that you'd download the file first and then send it out. But that would not really work for big files.

I have other an idea.

(Avobe don't need resource_url column in spree_digital table)

... Or we can ignore the big file problem ... :sweat_smile:

halo commented 9 years ago

I'm still trying to understand your specific use case a little bit better. So you provide hosted spree stores for your customers, but you don't want to accept file uploads?

Then, store begins to download the file from resource URL and save it to attachment server

Could you not just download the file yourself and then click on Browse... and choose it from your disk?

camelmasa commented 9 years ago

I'm still trying to understand your specific use case a little bit better. So you provide hosted spree stores for your customers, but you don't want to accept file uploads?

I'll share our use cases.

Yes, we don't want to accept file uploads. "our customers" can change the resource URL's file but can't change the resource URL.

so sorry we can't following idea because we'll save old files.

I have other an idea. You input resource URL. Then, store begins to download the file from resource URL and save it to attachment server (e.g. S3). Customer can download it from attachment server.

halo commented 9 years ago
  • You input resource URL.
  • Then, store begins to download the file from resource URL and save it to attachment server (e.g. S3).
  • Customer can download it from attachment server.

That sounds fairly reasonable to me. Basically, the source could not only be your hard-disk but a remote file. A little bit like Gravatar where you can choose "from disk" or "from URL".

But what do you mean by attachment server? You said that you don't want people to upload files, but if they can choose an URL, is that technically not the same thing? I mean, how is that more secure? Why don't you allow customers to upload a file from disk, but would allow it from an URL?

Above don't need resource_url column in spree_digital table

True, it would reduce the complexity a lot. And it would also be more backwards-compatible.

I don't understand your following statements:

Yes, we don't want to accept file uploads. "our customers" can change the resource URL's file but can't change the resource URL.

What do you mean by that?

so sorry we can't following idea because we'll save old files.

So you cannot do what you suggested?