Jump to content



Photo
- - - - -

separately uploaded image

separately uploaded image

This topic has been archived. This means that you cannot reply to this topic.
24 replies to this topic

#1   xvoyance

xvoyance
  • Members
  • 87 posts

Posted 21 April 2012 - 13:25

I upload my products images separately with FTP and put under catalog/images.
How could I tell OSC 2.3.1 when I create new products that their images are there?

Thanks.

#2   GemRock

GemRock
  • Members
  • 2,074 posts

Posted 21 April 2012 - 13:43

if you dont want to edit the product and let it upload the image which does two things: upload image and write image name to the db, then only way is enter the image name in the product table in the db.
Ken
commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).
over 20 years of computer programming experience.

#3   xvoyance

xvoyance
  • Members
  • 87 posts

Posted 21 April 2012 - 14:41

if you dont want to edit the product and let it upload the image which does two things: upload image and write image name to the db, then only way is enter the image name in the product table in the db.
Ken


I also want to edit the products, since there are other fields need to fill out. So, how should I tell osc that the image is there?

#4   GemRock

GemRock
  • Members
  • 2,074 posts

Posted 21 April 2012 - 15:35

well, it sounds like you drove from a to b but then you decided you should take a coach/bus to go from a to b so you drove back to a and take a coach/bus. you try to tell the coach driver not to charge you because you already been to b early on but i guess you wont be successful. outcome: your first trip to b is a complete waste, or for your question, you ftp'ed the image to server is a complete waste, and there is no easy way such as a tick box to tell edit/add new not to upload iamge.



Ken

Edited by GemRock, 21 April 2012 - 15:42.

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).
over 20 years of computer programming experience.

#5   GoTTi

GoTTi
  • Members
  • 448 posts

Posted 21 April 2012 - 15:52

are your images in consecutive order like 1.jpg, 2.jpg, 3.jpg, etc? if they are, use the easy populate addon and you would be on the right path to getting it done quickly.

#6   GemRock

GemRock
  • Members
  • 2,074 posts

Posted 21 April 2012 - 16:10

further to my comment, you can try to comment out the upload product image code in categories.php. i dont have the file at hand so cant tell you where they are.

Ken
commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).
over 20 years of computer programming experience.

#7   xvoyance

xvoyance
  • Members
  • 87 posts

Posted 21 April 2012 - 23:39

further to my comment, you can try to comment out the upload product image code in categories.php. i dont have the file at hand so cant tell you where they are.

Ken


COMMENT OUT? sure, that is easy, i know how to do it. (You can actually leave it there.) But how to tell the system the file is there? That is my question.

#8   spooks

spooks
  • Members
  • 7,017 posts

Posted 22 April 2012 - 12:04

As gotti said use easy populate, or phpMyAdmin but perhaps this thread will help you see better http://forums.oscomm...for-the-newbies
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#9   GemRock

GemRock
  • Members
  • 2,074 posts

Posted 22 April 2012 - 14:06

...But how to tell the system the file is there? That is my question...

the answer is easy: as you say you are going to edit the product (or add new product for that matter), during the process, you browse to the image file on your local pc, then the system will save the image file name in the db w/o uploading it again to the server, that way, it will tell the system the file is there by matching the file you FTP'ed to server and the name of same file in the db. but if you want to detect whether files have been uploaded to server, if yes then no upload; if no then do the upload, then the whole thing wont be as easy as just comment out a file lines of code. it becomes complicated albeit still do'able (NOT worthy it at all imo).

Ken
commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).
over 20 years of computer programming experience.

#10   xvoyance

xvoyance
  • Members
  • 87 posts

Posted 23 April 2012 - 12:07

As gotti said use easy populate, or phpMyAdmin but perhaps this thread will help you see better http://forums.oscomm...for-the-newbies


Could Easy Polulate support in-line input data
i.e. put my input data in the http command line like
http://www.mysite.co...me="aasdsa"....
instead of file upload?

#11   spooks

spooks
  • Members
  • 7,017 posts

Posted 23 April 2012 - 12:14

Such things can be done if only the get method is used and you ensure sessions remain (cookie use) but I suspect that uses post, read the add-ons documentation

Caution: pure use of the query string to pass data to the dBase is an invite to hackers
Sam

Remember, What you think I ment may not be what I thought I ment when I said it.

Contributions:


Auto Backup your Database, Easy way

Multi Images with Fancy Pop-ups, Easy way

Products in columns with multi buy etc etc

Disable any Category or Product, Easy way

Secure & Improve your account pages et al.

#12   xvoyance

xvoyance
  • Members
  • 87 posts

Posted 24 April 2012 - 23:02

if you dont want to edit the product and let it upload the image which does two things: upload image and write image name to the db, then only way is enter the image name in the product table in the db.
Ken


Could you please tell me how to insert directly into the db? Thanks.

#13   GemRock

GemRock
  • Members
  • 2,074 posts

Posted 25 April 2012 - 07:37

you use phpMyAdmin (accessed from cpenal) to edit tables directly. after logging in to phpmyadmin, choose the db if there are more than one dbs, then select the products table, find the product you want to enter the product image, click Edit against the product in question, enter the file name of the product image into the field of products_image. if the image on the server is not directly under the images folder, ie, under sub-folder(s), then include the sub-folder(s) name(s) before the product image file name. click Save/Go button to save the entry.

if the image files are named in such a way that it uses the product name or model or product id, all of which are unique, then you can write a few lines of php code to insert product image name programmatically. the code can be saved as a php file and re-used every time after you FTP'ing images to server. it can be run is this way: http://www.yoursite....ages_to_db.php. thats how i do it.

Ken

Edited by GemRock, 25 April 2012 - 07:37.

commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).
over 20 years of computer programming experience.

#14   xvoyance

xvoyance
  • Members
  • 87 posts

Posted 25 April 2012 - 23:44

you use phpMyAdmin (accessed from cpenal) to edit tables directly. after logging in to phpmyadmin, choose the db if there are more than one dbs, then select the products table, find the product you want to enter the product image, click Edit against the product in question, enter the file name of the product image into the field of products_image. if the image on the server is not directly under the images folder, ie, under sub-folder(s), then include the sub-folder(s) name(s) before the product image file name. click Save/Go button to save the entry.

if the image files are named in such a way that it uses the product name or model or product id, all of which are unique, then you can write a few lines of php code to insert product image name programmatically. the code can be saved as a php file and re-used every time after you FTP'ing images to server. it can be run is this way: http://www.yoursite....ages_to_db.php. thats how i do it.

Ken


Sure, I know all what you said. I am trying the second way, i.e. writing a PHP to insert it directly into the DB.
But my question is how to write that code?
Can you write that line directly?

#15   jhande

jhande
  • Members
  • 2,236 posts

Posted 26 April 2012 - 01:02

Forgive me for being so naive...

But why all these scripts to populate the database with product info & image details?

Either use osC's admin panel or the Easy Populate contribution.

Just sounds to me like you're trying to reinvent the wheel. /huh.png' class='bbc_emoticon' alt=':huh:' />
- :: Jim :: -
- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

#16   xvoyance

xvoyance
  • Members
  • 87 posts

Posted 26 April 2012 - 01:23

Forgive me for being so naive...

But why all these scripts to populate the database with product info & image details?

Either use osC's admin panel or the Easy Populate contribution.

Just sounds to me like you're trying to reinvent the wheel. /huh.png' class='bbc_emoticon' alt=':huh:' />


Have you seen in a supermarket or a bookstore, which I am going to built, they use barcode scanner to scan the products and the products goes immediately into their computers, which is called "realtime".

EP is a batch processing.....People today have forgot what is "batch processing" /sad.png' class='bbc_emoticon' alt=':(' />

OSC admin panel could not retrieve the products information from libraries, such as google books or ISBNDB or OPENLIBRARY, not either their images. Furthermore, I do not want to fill out the form for 100000 books with possibility to make mistakes. 100000 books is only a mini (a scale less than nano, presumably you all know what is nano but not batch) book store!

Edited by xvoyance, 26 April 2012 - 01:33.


#17   jhande

jhande
  • Members
  • 2,236 posts

Posted 26 April 2012 - 01:54

Thank you for the explaination.
- :: Jim :: -
- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

#18   xvoyance

xvoyance
  • Members
  • 87 posts

Posted 26 April 2012 - 02:06

Thank you for the explaination.


I have actually finished everything, i.e. fill out the form automatically, except the last step for image, which need to insert into DB directly.

I f you can help you I can achieve that quicker.

#19   GemRock

GemRock
  • Members
  • 2,074 posts

Posted 26 April 2012 - 12:41

the code can be downloaded from my website (see profile) on shop demo & test bed home page.

Ken
commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).
over 20 years of computer programming experience.

#20   xvoyance

xvoyance
  • Members
  • 87 posts

Posted 26 April 2012 - 15:39

got it. investigating........

Edited by xvoyance, 26 April 2012 - 15:44.