Images Won't Upload/Save

Questions around the TYPO3 integration and plugins as well as Flow and NeosCMS
Forum rules
Always add your TYPO3/Flow, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
superscotty19
Posts: 90
Joined: 13 May 2019, 08:09

Images Won't Upload/Save

Post by superscotty19 » 08 Jun 2019, 00:40

Hi,

TYPO3 8.7
Aimeos 18.10.8
Aimeos_dist 18.4.0

This is weird. I have 2 Aimeos TYPO3 installs. The first is a vanilla install, and works fine. The 2nd is essentially the same as the 1st (I may have moved a content element and/or removed unneeded currencies, but nothing major). However, in the 2nd install, no matter what I do I cannot upload images to a product. Specifically:

1.) I go to Aimeos Shop > Products > New
2.) I go to the Images section and click to add a file > choose a file from my PC > Click Save
3.) The file name is saved but the image itself is nowhere to be found - no thumbnail, and not on the server's directory

As a last resort, I even went to Template > Constant Editor and explicitly set a URL for the files:
Content Base URL = http://www.domain.com/fileadmin/client/storage/products
Content base URL (BE) = http://www.domain.com/fileadmin/client/storage/products
... but still nothing, and I know the Base URLs specified are correct because I saved a txt file in it and I can access it via browser URL.

Help? (Thanks)
-Scott.

User avatar
aimeos
Administrator
Posts: 3207
Joined: 01 Jan 1970, 00:00

Re: Images Won't Upload/Save

Post by aimeos » 09 Jun 2019, 09:36

Uploaded files are saved in ./uploads/tx_aimeos/*/ directory and subdirectories. Maybe a permission problem?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

superscotty19
Posts: 90
Joined: 13 May 2019, 08:09

Re: Images Won't Upload/Save

Post by superscotty19 » 11 Jun 2019, 04:38

Hi,

I could see that the /uploads/tx_aimeos directory was 775 and I know my host cpanel complains if a directory is writable by the group, so I set it to 755 and images are uploading now. So, you were right - permissions - thanks ;)

However, even though they are uploaded - that is, I can see a file in /preview and /files - the preview image isn't showing up in the product listing. All I see is the file name (see attached). It's almost as if there's some sort of caching issue ... ?

---

One last thing: I need to change the upload directory (so that I can manage the file through the T3 Filelist). Specifically, I want to save to /fileadmin/mysite/storage/products. So, I went to the template -> Constant Editor to change the constants:

plugin.tx_aimeos.common.content.baseurl = /uploads/tx_aimmeos
module.tx_aimeos.common.content.baseurl = ../uploads/tx_aimeos

to

plugin.tx_aimeos.common.content.baseurl = /fileadmin/mysite/storage/products
module.tx_aimeos.common.content.baseurl = ../fileadmin/mysite/storage/products/

...respectively, but aimeos is still saving to uploads/tx_aimeos. Is this not correct? Do I need to make a linux symlink instead?

Thanks as always!
-Scott.
Attachments
Screenshot_2019-06-10 [TYPO3 CMS 8 7 4].png
Screenshot_2019-06-10 [TYPO3 CMS 8 7 4].png (38.82 KiB) Viewed 196 times

User avatar
aimeos
Administrator
Posts: 3207
Joined: 01 Jan 1970, 00:00

Re: Images Won't Upload/Save

Post by aimeos » 11 Jun 2019, 07:29

superscotty19 wrote: plugin.tx_aimeos.common.content.baseurl = /fileadmin/mysite/storage/products
module.tx_aimeos.common.content.baseurl = ../fileadmin/mysite/storage/products/

...respectively, but aimeos is still saving to uploads/tx_aimeos. Is this not correct? Do I need to make a linux symlink instead?
The baseurl setting is to tell the Aimeos templates the path/URL for the browser. The filesystem location is defined in ./typo3conf/ext/aimeos/Resources/Private/Config/resource.php in the "fs" (filesystem) section. You can overwrite that configuration settings in your own Aimeos extension using a file with the same name.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

superscotty19
Posts: 90
Joined: 13 May 2019, 08:09

Re: Images Won't Upload/Save

Post by superscotty19 » 11 Jun 2019, 08:17

Code: Select all

./typo3conf/ext/aimeos/Resources/Private/Config/resource.php
Perfect! That's exactly what I needed, and it's working.

Now back to the image preview .... since my last post, I didn't touch the system. Now, I've went back in and clicked on a product ... and the thumbnail is showing in the backend! ... But not all, and nothing in the frontend - catalog looks empty.

I'm pretty sure it's not cache since I went into the Extension Manager and set the cache.cacheName setting to "None", as per your instructions from another thread. Is there some sort of scheduler job or indexer that builds up the thumbnails?

-Scott.

superscotty19
Posts: 90
Joined: 13 May 2019, 08:09

Re: Images Won't Upload/Save

Post by superscotty19 » 11 Jun 2019, 08:32

Update...
After changing the "fs" path in resource.php and setting cacheName in Extension Manager, files are properly uploading/saving to the new directory. However, my backend and frontend previews/files are still referencing /uploads/tx_preview (evident in the Inspector). So, I went to the Install Tool -> Important Actions -> Clear All Cache. Still the old directory....
I thought maybe there was a problem with the baseURL (because I'm using a dev server without a domain, i.e. https://server.domain.com/~user/typo ) so I explicitly set it in constant editor. Didn't work either (and yes, all other links work)

:-/
-S.

User avatar
aimeos
Administrator
Posts: 3207
Joined: 01 Jan 1970, 00:00

Re: Images Won't Upload/Save

Post by aimeos » 11 Jun 2019, 21:27

Do you have APCu enabled? Then, the web server caches the configuration and updating the config doesn't have any effect until you clear the APCu cache or restart the web server.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

superscotty19
Posts: 90
Joined: 13 May 2019, 08:09

Re: Images Won't Upload/Save

Post by superscotty19 » 11 Jun 2019, 22:45

Hi,

Nope - and good idea - but it doesn't matter because I GOT IT!!!!!!

Because I changed the storage directory in resources.php, I also had to set the BaseURLs in the Constant Editor.

So, for anyone reading this, here's the fix if you ever have issues with and/or need to move image locations.

1.) Make sure the directories that will house the files are 755 permissions (that is owner read/write/execute, group/world read/execute). For example, fileadmin/user/products
2.) Change the 3 paths in resources.php to be the path from (1) or make your own extension to do so. Note: if you do the former, then the setting will most likely get overwritten with an upgrade.
3.) In Template > Constant Editor > aimeos (advanced) > set content base URL and base url (BE) to be the FQDN of (1). For example, https://shop.domain.com/fileadmin/user/products

THANK YOU SO MUCH, AGAIN(!!!!), for sticking with me on this! I've been face-deep in this system for a couple weeks now and between it and your amazing support I am LOVING aimeos! In fact, it will be the recommended platform for all future e-commerce projects AND to pay back the support I've been given, I'll be making a tutorial set for beginners.

All the best,
-Scott.

Post Reply