Filepaths for Cron CSV import

  • Posts: 9
  • Thank you received: 0
  • Hikashop Business
4 months 1 week ago #295020

-- url of the page with the problem -- : www.samwelsupplies.com
-- HikaShop version -- : 3.5.0
-- Joomla version -- : 3.8.10

Hi All,

I am trying to setup the automatic import of the CSV files to update my webshop.

Right now I am at a total loss as how to format the file locations. because I get strange behaviour

The CSV file is put onto the webserver via FTP ( automatically via batch file)
/httpdocs/media/com_hikashop/upload/safe/export.csv

When I put this file location into the cron plugin and test run the cronjob, it gives me the following error:
Could not find the file /srv/psa02/samwelsupplies.com/httpdocs/httpdocs/media/com_hikashop/upload/safe/export.csv

Naturally, I see that there is a doubled httpdocs in the filepath, and there should be only one. So the first thing I tried is ofcourse remove the /httpdocs part from my filepath.. When I do that and testrun the cron job I get the following error;
Could not retrieve the CSV file www.samwelsupplies.com/media/com_hikasho...load/safe/export.csv

As you can see, by removing the /httpdocs from my filepath, it not only went from a local filepath to a webpath ( why?), but it also removes the double httpdocs altogether.. So I have no way of getting it to link to /srv/psa02/samwelsupplies.com/httpdocs/media/com_hikashop/upload/safe/export.csv -- with just one httpdocs in the filename..

Oh and if I try to put in this entire path, it just gives the same error but with:
/srv/psa02/samwelsupplies.com/httpdocs/httpdocs/media/com_hikashop/upload/safe/export.csv/srv/psa02/samwelsupplies.com/httpdocs/httpdocs/media/com_hikashop/upload/safe/export.csv could not be found...

so my problem is, how on earth do I this thing pointed into the right path?!

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
  • Hikashop Business
4 months 1 week ago #295025

OK i have found a workaround. From another topic posted here I got the idea to make a folder in /httpdocs as /httpdocs/cron.

exported file there, imported it from there, and it works.

seems like the upload folder of the media folder is somehow protected?

Now the final question I have is if the file can be auto deleted after its used. I have seen a swtich in hikashop that should do this, but it seems to be not deleting the file from the /httpdocs/cron folder... I am not really fond of having a copy of my entire database sitting in a folder where I am not sure how accesible it is to others..

Please Log in or Create an account to join the conversation.

  • Posts: 63979
  • Thank you received: 9222
  • MODERATOR
4 months 1 week ago #295035

Hi,

The best though would be to put the file in the folder /srv/psa02/samwelsupplies.com/ so that it can't be reached by someone else even before HikaShop import runs.
Just make sure that the user, group and permissions of the file allow the website unix user to read and write the file and the plugin will be able to use it AND will be able to delete it if you activate that option of the plugin.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
  • Hikashop Business
4 months 1 week ago #295122

Hi Nicolas,

Thanks for the reply. I was not aware the plugin could function outside of the httpdocs folder (outside of its root). I will experiment with this later on, for now I got it working the way I described before, but I do agree, better to have such files outside of the web accesible parts. the removal of the file seems to be not working, but I will surely figure that one out later

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
  • Hikashop Business
4 months 5 days ago #295354

Hi nicolas,

I have tried using your suggestion of putting the file above the HTTPdocs folder ( so lets say above the root of my website)

I get the following cron error: Could not find the file /srv/psa02/samwelsupplies.com/httpdocs//srv/psa02/samwelsupplies.com/cron/export.csv

the value I have given in the cron plugin is: /srv/psa02/samwelsupplies.com/cron/export.csv
Edit: the folder samwelsupplies.com is the root of what I am able to access via the FTP client

It just cant work around the httpdocs ( it looks into there by itself..) how do I force it to go to a folder above?

Last Edit: 4 months 5 days ago by samsup.

Please Log in or Create an account to join the conversation.

  • Posts: 22972
  • Thank you received: 3562
  • MODERATOR
4 months 3 days ago #295373

Hello,

Since the message is giving you the path :

/srv/psa02/samwelsupplies.com/httpdocs//srv/psa02/samwelsupplies.com/cron/export.csv
You should provide a relative path from the "httpdocs" folder.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum