Upload Files via API

Highlighted
New Member
1 0 2

Is there a way to upload files into the files section (not assets or products/images) via the api yet?  I found this post and a few others but they're all two years old so I am hoping. 
Thanks

2 Likes
Highlighted
Shopify Expert
9925 103 1763

Hey James,

There's currently no Files API for adding content to /admin/files section of the Admin.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
Shopify Expert
73 1 41

That would definitely be a killer! Also opening this to the Shopify Embedded SDK would be awesome. Currently we have an app that requires file uploading but files are uploaded to S3 or whatever either service. Which is cool but does not come with all the nice filters Shopify provide on image to generate smaller copies of images.

0 Likes
Highlighted
Shopify Expert
4175 29 400

Ask the developer of the App to add that. Since days long before Amazon even existed as a cloud service, ImageMagick has existed to create alternate versions of images. So there is really nothing new to that, and almost all examples of file uploaders come with image altering as their premise. 

Seems a no-brainer and hence if your App is just vanilla uploading, ask for other flavours. Who could say no to that?

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted
Shopify Expert
73 1 41

No need ot answer in such condescending ways (it's not the first time you're doing it, especially since you're often answering without getting the question and needs right)...

Using ImageMagick instead needs that you need additional infrastructure, while I currently just upload images directly to S3 (not even need to handle the file upload using a server).

Having the possibility to upload directly to Shopify Files has a ton of advantages. Users can use the traditional filters and do that kind of things: {{ 'my_image.jpg' | img_url: '400x', crop: 'center' }}.

Obviously you can do that server-side as well, but you would need to support all the features Shopify support (arbitrary sizes, crop, scale parameters...), which would mean handling your own infrastructure to that. That requires time, money... while Shopify could just open their files API or add it to app to upload directly to files.

So I'm returning your own question: who could say no to that?

1 Like
Highlighted
Shopify Expert
4175 29 400

First off, there is zero condenscending in my answer. Look up the english definition. You said you have an App that requires image manipulation. Your english poorly communicated the fact that this App was written by YOU.

So getting back to your question, stop shooting the messenger and instead read the answer provided, which in this case, is likely the correct one. Even a cursory (brief) review of uploading to S3 includes ways where your upload could signal extra processing (a filter) along with the data.

The OP asked about upload to /files... was told it is impossible. Now you chime in you have to upload to S3 but cannot stomach extra processing, and are miffed you cannot provide Liqud access to said images with filters. You really want to get into that? There are a couple of questions here. If you're directly and securely uploading to S3, you are in fact talking to your server first. So you have infrastructure in place, otherwise you'd have no key to S3. As for downloading images from S3, that is custom anyway, so building in filters remains your domain anyway...   

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted
Shopify Expert
73 1 41

I suggest you re-reading your answers (in general) in all threads in this forum :). This one as well.

Indeed, the app is written by me (so my broken English conveyed the right message then :)), and I'm indeed trying to find the best solutions for my users.

What I'm trying to explain is that you are providing solutions which are indeed valid (yes, uploading to S3 or whatever providers is valid, yes you can as well do post processing / pre processing / processing on the fly, yes you can automatically generate multiple sizes yourself).

But I think that most app that deals with file upload is to display them at some point somewhere in the storefront, in emails, in PDF... or whatever.

If you wanted to replicate what Shopify gives you for all images with the img_url filter, yes you could definitely do it with the way you've explained BUT as I told you it would introduce A LOT of complexities when this is already developped by Shopify which could just open this API.

Have a nice Sunday too !

0 Likes
Highlighted
Shopify Expert
4175 29 400

You want the Shopify under-the-hood image processor at your disposal for images that are not inside Shopify? 

All to save yourself a bit of work? Right.. and I am the bad guy... 

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
Highlighted
Shopify Expert
73 1 41

Pleeeeease... It's not because I emitted a small criticism in your answers that you need to act this way :(. I never told you that you were a bad guy. You're actually often very helpful and I really appreciate that you take the time to answer in those threads. Just wanted to say something that I've felt through a lot of your answers when you give answer a bit too "bolded" without sometimes getting the full context. And attacking me on my English knowing I'm not native and that I'm trying my best is not the best defence imho. But well... let's close that!

First, it's not "a bit of work" to replicate all what Shopify is doing (but you're likely having much more experience than me on that).

As said (please try to understand that), there are huge advantage of using the files API is that people can use the EXACT same Liquid code to benefits from all the features Shopify has.

The question wether it belongs to Shopify is interesting. I'd say that if you're offering an app that would allow to add, let's say, additiona images to a blog post, I don't see how much different it is from the "featured image" Shopify has. You're extending the platform but at the end, the images belong to the store and are used strictly in the context of your store. But yeah, I agree that this could be abused from some people that would use Shopify as a free S3 to use the images strictly outside the scope of a Shopify store.

Actually, because the Shopify has a section "Files" where you can upload manually and without any limit all the assets you want, I could also simply replace my "Upload files" feature by just a URL where the merchant would have to upload first the image in the Files seciton, and copy-paste the URL.

1 Like
Highlighted
Shopify Expert
49 0 17

I agree, I would like to upload files directly into a store instead of hosting them myself on s3. 

This is an API that people have been asking about for years.

5 Likes