Jump to content

Where to host images so that share link has a valid image extension? CSV Product Import

Recommended Posts

Posted

I am in the process of importing my products with the upload template CSV. I have all of my images hosted within our company Google drive, and have added the public share links to my CSV under "Hosted Image URLs."

After importing, though, only a blank square with a grey diagonal slash is visible where an imported photo should be. My guess is this is because my URLs don't end in .jpeg, .png, etc. 

Is there a way to get a link to my images hosted in Drive so that I won't encounter this problem? Is there a different hosting service I should be using that will automatically generate a link with an image extension?

  • Replies 20
  • Views 4.4k
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Use the following URL structure.

https://drive.google.com/uc?export=view&id=1JUg5lvcdLhuKhxhOKjvqtSGzB0JKRj8T

uc?export=view&id=1JUg5lvcdLhuKhxhOKjvqt

Using search and replace change...

file/d/

 

...to...

uc?export=view&id=

Let us know how it goes.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

  • 1 month later...
Posted

Amazing answer !

Would you have any advice for me? I have 100 JPG files and would like to get them automatically added to the CSV file for 100 distinct products, but don't know how do to that efficiently.

Shall I copy them all to Google Drive? How would I then get their 100 distinct random URLs to shove them into the CSV?

Posted
9 hours ago, creedon said:

@DanielVanDenSchnurtz

Please see the following. The main point is that unless your images are already hosted somewhere then it would probably be faster to do them manually.

 

Thank you for your prompt answer ! There are hundreds of images, and manual import is not an option 🙂

Posted (edited)

@DanielVanDenSchnurtz

Upload the files to Google Drive in a folder.

There are probably limits to how much GD can handle at a time so you may want to upload in batches.

Then go into the folder and select the files. Right click and click Share.

1204516632_ScreenShot2021-03-10at12_07_49PM.png.de101c627c95672ffd99841fec2d6c1b.png

In the Share dialog click Change .

116000141_ScreenShot2021-06-10at9_44_34AM.png.50e7b849a32b5ce697eccce805bc165b.png

Set all the links to share with anyone, click Copy links, and Done.

160507280_ScreenShot2021-06-10at9_46_58AM.png.04ad93285b54b97d0fdbde1fcf19e299.png

The links should now be on the clipboard.

From there paste into a text editor to start manipulating the links. They will come over as a comma separated list.

I don't know how many files you can do at once like this in GD. So you may want to work in batches at this step as well. Start of with something like 25 files.

Edited by creedon

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

  • 2 months later...
Posted

@creedon I can't seem to get this to work for GLB files (need url for model-viewer).

I saw another thread where you referred to this one, but does this only work for images, and do I need another approach for GLB files?

Posted

@babrsome

It looks like it might be a CORS issue. I just tested trying to load a glb from Google Drive and got the following.

137224457_ScreenShot2021-06-15at5_10_50PM.thumb.png.f826277e4f6423dbb242c5bc6e4ae04b.png

Digging a little deeper it appears that Google is redirecting some or all drive url requests to another server. Apparently CORS is not robust enough to deal with the redirect down the line. It's interesting as the first server indeed is not set up to allow all comers as far as CORS is concerned. The second server is set up to handle all comers per CORS.

I don't have a solid handle on all the ins and outs of this mess so take everything with a grain of salt.

You'll need to find another server/service that doesn't have an issue. Dropbox perhaps? I did test Amazon S3 and was able to get a test file to work there after setting a CORS policy. But that is not on most people's list of go to file server, services. S3 is for the very technically inclined but it works great when configured properly! 🙂

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

  • 3 months later...
Posted
On 6/16/2021 at 3:44 AM, creedon said:

@babrsome

It looks like it might be a CORS issue. I just tested trying to load a glb from Google Drive and got the following.

137224457_ScreenShot2021-06-15at5_10_50PM.thumb.png.f826277e4f6423dbb242c5bc6e4ae04b.png

Digging a little deeper it appears that Google is redirecting some or all drive url requests to another server. Apparently CORS is not robust enough to deal with the redirect down the line. It's interesting as the first server indeed is not set up to allow all comers as far as CORS is concerned. The second server is set up to handle all comers per CORS.

I don't have a solid handle on all the ins and outs of this mess so take everything with a grain of salt.

You'll need to find another server/service that doesn't have an issue. Dropbox perhaps? I did test Amazon S3 and was able to get a test file to work there after setting a CORS policy. But that is not on most people's list of go to file server, services. S3 is for the very technically inclined but it works great when configured properly! 🙂

Thanks for the diagnostics !! Will leave Google Drive then :-). A nice loss to experience.

  • 1 month later...
Posted

@creedon Sorry for making you revisit this topic, but I am having the same issue with uploading my glb url using both Dropbox and Google Drive. Obviously, I have run into the same CORS policy error. I was wondering if you could shed some light into how you did the amazon s3 workaround? 

Posted

Site URL: https://chiton-emu-rrb3.squarespace.com/

Hello, 

I am trying to use the open source <model-viewer> code to upload an interactive 3D model to my website. I have successfully integrated the model viewer with an example model that is hosted on their server that doesn't run into any CORS policy errors. However, when I try to change the "src=" to my own url for my own glb model using both Dropbox and Google Drive, I run into the dreaded CORS policy error. I am not entirely sure how to get around this error without using js and setting up my own proxy server (which I have no idea how to do anyways).

I saw elsewhere that someone successfully circumvented the CORS policy by using Amazon S3? I was hoping someone could shed some light on that workaround so I may use it myself. Thank you so much!

  • 2 months later...
Posted
3 hours ago, caiphus said:

Is there a reason why we can't host our glb and usd files directly on our squarespace site?

I don't work for SS so I can only give you my opinion. The reason is simply that glb files are a very niche file type so it is simply not on SS's radar to support them.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

  • 4 weeks later...
Posted

Just following on alfredyay's post. 

I've also been looking at how to get a valid URL to host a .glb using squarespace and its seems that amazon s3 is the best way to do it. 

Does anyone know the set up in s3 required to make the .glb run. I.e. the permissions required on both the bucket setup, permissions on the actual .glb file and any cors permissions (or other factors)

I'm pretty sure the code set up I have is fine on the squarespace site as I can get the default dev model astronaut to appear. I've also managed to set up a poster images via an s3 url and that loads ok - it's just the .glb that I can't get to load. 

The .glb works on the model editor tester too. 

Any advice most appreciated. 

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.