Upload image as custom field

  • Posts: 10
  • Thank you received: 0
12 years 4 months ago #55834

Hi.

I've created a custom field, in the item table, of type "File".

When i try to add a image to the order the following message shows:


JFTP: :store: Bad response
Warning: Failed to move file!


Also, in the cart, the file is shown and the user can click on it and download again, but it's not visible in the order page, on the back-end.

I'm sure it's a permissions issue, but i think have everything set to 664. Which directory hikashop uses to upload these files?

Thanks!

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

  • Posts: 10
  • Thank you received: 0
12 years 4 months ago #55835

I've enabled "back-end listing" in the custom field and now it's displayed in the order page, but still shows the error when the user adds it.

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

  • Posts: 82818
  • Thank you received: 13364
  • MODERATOR
12 years 4 months ago #55894

Hi,

The files are stored in the folder media/com_hikashop/upload/safe. Please check that your FTP user can write in that folder (I indeed think that it's a permission issue).

If you can't find you why it won't let your ftp user move the file after upload, try to turn off the FTP layer in the joomla configuration. That way, it will be the apache user which will try to move the file and it might work better.

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

  • Posts: 10
  • Thank you received: 0
12 years 4 months ago #56092

Changing media/com_hikashop/upload/safe permissions to 777 doesn't worked.

Disabling FTP layer does worked.

Thank you!

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

  • Posts: 32
  • Thank you received: 1
12 years 4 months ago #56598

I have the same problem. Making hte "safe" folder writeable by the webserver -- although it defeats the whole purpose of the safe folder -- does result in the file getting copied, while the jftp error message still appears.

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

  • Posts: 82818
  • Thank you received: 13364
  • MODERATOR
12 years 4 months ago #56612

Making the safe folder writable does not defeats the purpose of the safe folder.
The safe folder is safe because there is a .htaccess file which prevents anyone from accessing the files via a URL.
Making that folder writable just allows your website to write the files you upload in it.

The JFTP error means that the joomla FTP layer cannot copy the file in the safe folder. If you turn off the joomla FTP layer of the configuration of joomla, you should not get the error as it will be your web server which will copy the file.

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

  • Posts: 32
  • Thank you received: 1
12 years 4 months ago #56632

Making the safe folder writable does not defeats the purpose of the safe folder.


Well, the documentation suggests the safe folder should not be writable by the webserver user -- should be placed entirely outside the web tree in fact -- so that in case your joomla installation gets hacked, these files may not be lost. So, that stated purpose at least is defeated.

If you use apache mod_php (not cgi php) with multiple distrusting sites, the ftp layer is quite useful, btw. I hope it woudl be supported.

Cheers,

-Henry

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

  • Posts: 82818
  • Thank you received: 13364
  • MODERATOR
12 years 4 months ago #56672

The documentation does not suggest that the folder should not be writable and it doesn't say either anything about loosing the files :

Please make sure this folder is writable otherwise HikaShop won't be able to upload your files in it. We recommend to put this folder outside your joomla installation folder. That way, if your website is hacked, you have more chances that the products files won't be changed. By default the folder is inside the Joomla installation folder but protected with an .htaccess to prevent access via the web. Only possible access will be via FTP,SSH or PHP.

So I maintain what I said in my previous post.

Indeed, if you use mod_php with multiple distrusting sites, you should use the FTP layer. HikaShop supports it. That's why you get that error when it is activated which means that between your folder access rights, your tmp folder access rights and the FTP user permissions, the FTP user cannot move the uploaded files from your tmp folder to the safe folder.

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

  • Posts: 32
  • Thank you received: 1
12 years 4 months ago #56704

Indeed, if you use mod_php with multiple distrusting sites, you should use the FTP layer. HikaShop supports it. That's why you get that error when it is activated which means that between your folder access rights, your tmp folder access rights and the FTP user permissions, the FTP user cannot move the uploaded files from your tmp folder to the safe folder.


Ah, so you are suggesting the fault might be in my configuration. I don't think so, but I prefer that to thinking your solution to fix the bug was to disable the feature. ;-)

I will investigate it some more. I already tried the usual things that challenge joomla components from using ftp, such as some need an absolute path to the tmp folder, or wanting something like ./htdocs3 or whatever in the ftp config instead of just htdocs3 (the /htdocs3 suggested by "auto find" rarely works). I will let you know if I find anything useful.

Thank you for all you do -- this software really is some of the best I ever used with Joomla -- by far. So I hope I don't sound critical.

-Henry

Last edit: 12 years 4 months ago by hkingman.

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

  • Posts: 32
  • Thank you received: 1
12 years 3 months ago #60213

On my server, Hikashop appears to tolerate the JFTP layer, as long as your temp directory ends in a slash. i.e., if you change:

/path/to/tmp-folder/for/example/htdocs/tmp

to

/path/to/tmp-folder/for/example/htdocs/tmp/

Hope it helps

The following user(s) said Thank You: nicolas

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

  • Posts: 26
  • Thank you received: 0
12 years 2 months ago #63576

:( As I can do to make each product added on the shopping cart has a field that allows a file upload jpg, png, tiff etc.

Thanks for you help

Attachments:

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

  • Posts: 26
  • Thank you received: 0
12 years 2 months ago #63578

As I can do to make each product added on the shopping cart has a field that allows a file upload jpg, png, tiff etc.

thanks

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

  • Posts: 82818
  • Thank you received: 13364
  • MODERATOR
12 years 2 months ago #63810

You need to create a custom field of the table "item" and of the type "image" via the menu Display->Custom fields with the business edition.

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

Time to create page: 0.095 seconds
Powered by Kunena Forum