Problem with link image

Hi everyone, I have created an appsheet for uploading products to a woocommerce site. Everything works perfectly except for the images, I use the following formula to get the link of the image: = IF (ISBLANK (UX! M2) ;; REPLACE (concatenate ("https://www.appsheet.com/template/ gettablefileurl? appName = ";" WAKEUP-INVENTARIO-6283747 ";" & tableName = ";" UX ";" & fileName = "; UX! M2);" ";"% 20 "))

The image is reachable, but in php the link does not return the image which causes an error when I try to import the csv on woocommerce.

Is there another way to have a direct link to the image? Has anyone already tried to do something similar?

Please help me, I've been struggling with this problem for days!

Solved Solved
0 7 181
1 ACCEPTED SOLUTION

I solved the problem, I share the solution here in case someone has the same problem as me

I managed to trace the function that manipulated the url:
In the wc-rest-funcions.php file.

function wc_rest_upload_image_from_url( $image_url ) {
...
$file_array         = array();
$file_array['name'] = basename( current( explode( '?', $image_url ) ) );
...
}

I changed the affected string as follows :

$file_array['name'] = basename( $image_url );

 

View solution in original post

7 REPLIES 7

Welcome to the community!

The way you construct your URL to retrieve the image from the app is not related to AppSheet. Generally however, what I can see is that you have spaces everywhere, and you cannot have spaces in your URL. 

Hi, thank you for the welcome!
I have change the formula, and now i have this link :

https://www.appsheet.com/template/getappfileurl?appName=WAKEUP-INVENTARIO-6283747&tableName=UX&fileN...

I have removed all space, but from this link I continue not to be able to upload it to woocommerce.

I cannot understand where I am wrong

Thanks for all!

Your URL is now working and I can see the image. 

How are you uploading images?

I upload the image with csv
Share the link of google sheet : https://docs.google.com/spreadsheets/d/1RCJhtt-4wUE_i_U-wqP_f-2KW0Ax1WByCMS5blBcKg4/edit?usp=sharing

From investigations made, always that the appsheet link returns metadata on the image and not the image itself, this does not allow me to upload it to woocommerce

Sorry, I don't know. You might want to ask in a Woocommerce forum instead, for as far as your URL is concerned it is valid and the image is showing. 

I'm already asking, they told me the problem is the url not returning the image when called

I solved the problem, I share the solution here in case someone has the same problem as me

I managed to trace the function that manipulated the url:
In the wc-rest-funcions.php file.

function wc_rest_upload_image_from_url( $image_url ) {
...
$file_array         = array();
$file_array['name'] = basename( current( explode( '?', $image_url ) ) );
...
}

I changed the affected string as follows :

$file_array['name'] = basename( $image_url );

 

Top Labels in this Space