JoseLargo Posted November 22, 2018 Share Posted November 22, 2018 (edited) Hello, I´m try to make a script that import a feed of data of an API that provides product data and also let me download an image wich one is alredy stored in my server, but i dont know where should I store them, I have read in this forums about /img/p/ for products, the name of the image are the id of the product so finally the file with path is like /img/p/252.jpg, how can I tell to ps where is located my file or where and how should I locate them. I´m pretty lost, any clue is helpfull. I have been trying this. //adding images for the product $image = new Image(); $image->id_product = $id_product; $image->position = Image::getHighestPosition($id_product) + 1; $image->cover = true; // or false; if (($image->validateFields(false, true)) === true && ($image->validateFieldsLang(false, true)) === true && $image->add()){ $image->associateTo($shops); } Thanks for your attention. Edited November 22, 2018 by JoseLargo (see edit history) Link to comment Share on other sites More sharing options...
JoseLargo Posted November 22, 2018 Author Share Posted November 22, 2018 I got it, the path is the id of the image, being every single number of the id a folder inside the last one (Ej: image_id => 1004; folder => ./img/p/1/0/0/4/1004.jpg ), not very dificult to make, but a lil to find. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now