transfer.sh icon indicating copy to clipboard operation
transfer.sh copied to clipboard

Upload files from url

Open wuniversales opened this issue 4 years ago • 10 comments

I would like that you could add files from an external url, for example, pass the url of an image, or a video and that it be uploaded to this platform. Would it be possible to add the function? Thanks greetings

wuniversales avatar Sep 15 '21 23:09 wuniversales

@wuniversales do you mean from the command line or on the web UI?

paolafrancesca avatar Sep 30 '21 18:09 paolafrancesca

@wuniversales Could you elaborate more on the use case? Why would one not share the URL directly?

stefanbenten avatar Jan 09 '22 19:01 stefanbenten

One thing that I would use this for is storing files from urls that have a short amount of time to be accessed. For example, instagram videos have a hash and timestamp in the URL that prevent them from being viewed with that link after a couple hours.

bman46 avatar Jan 21 '22 20:01 bman46

An example of another site doing this is https://0x0.st/. They allow a key called 'url' to be posted in the body as form data and then they handle the upload from that link.

bman46 avatar Jan 21 '22 20:01 bman46

One thing that I would use this for is storing files from urls that have a short amount of time to be accessed. For example, instagram videos have a hash and timestamp in the URL that prevent them from being viewed with that link after a couple hours.

This might possibly violate rights and is not a good example in my mind.

stefanbenten avatar Jan 21 '22 22:01 stefanbenten

Regardless of the specifics, there are situations where uploading from a link would be useful. That also wont stop anyone from just uploading the file from a local copy, anyway.

bman46 avatar Jan 21 '22 22:01 bman46

I totally agree, it would not stop it. But certainly make it possible to track down who uploaded it in case of an takedown/abuse request.

stefanbenten avatar Jan 21 '22 22:01 stefanbenten

One thing that I would use this for is storing files from urls that have a short amount of time to be accessed. For example, instagram videos have a hash and timestamp in the URL that prevent them from being viewed with that link after a couple hours.

on top of the abuse problem, I see another one here: what content should be upload from the url? an instagram url with an embedded video should upload html of the page or the video? the second is out of scope for transfer.sh, the first would make the example improper ;)

uploading directly a remote content, like https://0x0.st/ does, doesn't need an extra feature in transfer.sh itself, for cli: something like curl http://example.com/image.jpg -o - | curl -X PUT -d @- https://transfer.sh/image.jpg should be enough. We can provide the code of a shell function in the README or examples in UI

from web UI the same could be similarly done directly in the frontend with some javascript, only drawback is that someone hosting a custom frontend should implement the same feature independently. this would favour a support directly in the backend, but I have to think how this can fit with what we have without being an hack

@stefanbenten what do you think about the different options?

paolafrancesca avatar Jan 21 '22 23:01 paolafrancesca

I do agree having a shell alias/function for the above command is fine and easiest. In that case, it would still pass the data via the client and check all boxes in my eyes.

stefanbenten avatar Jan 26 '22 11:01 stefanbenten

we should add an example box in the frontend, @stefanbenten

paolafrancesca avatar Mar 03 '22 06:03 paolafrancesca