Has anybody written a WAMP website that...
Posted by: timecott01 (---.plus.com)
Date: October 19, 2023 12:14PM

can be used to show images taken on a digital camera?
I store all camera images on a NAS and want to find a way to access these from a WAMP webserver on the same local LAN. As yet I have not had much luck, and previous responses here have not helped. Sorry!
My WAMP website uses PHP so I use that in web pages to generate the image file name. This may contain several folders i.e. /folder/folder/folder/image.extn. The extension is usually .jpg but can be .raw or .tiff - hence again I use php generate this bit too.
I have a secure login (I think it is anyway) to a WAMP website that allows access to the NAS. However, although I can browse the NAS from it, I cannot display any image file contents. I understand that this is because the target image file is not stored under the web root. I dont really want to copy it there either, as this seems counter productive.
Can I use an .htaccess file somewhere??
Local info: WAMPserver x64 on Windows Server 2008R2. PHP is 7.4. The NAS is another Windows Server 2008R2 x64 File Server.
If I have missed any required detail, let me know and I will add it. Thank you.
TIA Tim.

Options: ReplyQuote
Re: Has anybody written a WAMP website that...
Posted by: RiggsFolly (Moderator)
Date: October 19, 2023 02:14PM

This is really not the sort of thing this site is for!

Take a look at the Apache documentation relating to ALIAS. In order to access data not in the Apache Document Root, you create an Alias pointing to the folder where your data is and tell apache it is allowed to access it.

Start Here

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 10/19/2023 03:00PM by Otomatic.

Options: ReplyQuote
Re: Has anybody written a WAMP website that...
Posted by: timecott01 (---.plus.com)
Date: October 21, 2023 12:05PM

Still unsure. An image to display may be several folders down on the NAS i.e.
disk:/folder/subfolder/subfolder/image.jpg
and the next image may be
disk:/folder/image.jpg

...and the file extension may be .jpg, may be .tiff etc.

hence the URL for the image to display is composed in php following browsing of the NAS

It looks to me like the alias would need to be different each time i want to use it to access an image file. But I dont see any examples where I can do this. Am I on the right track?? Sorry for -persistence-

Options: ReplyQuote
Re: Has anybody written a WAMP website that...
Posted by: Otomatic (Moderator)
Date: October 21, 2023 03:18PM

Hi,

You can define an alias of the form :
Alias /myimages "//NASname/folder/"
<Directory "//NASname/folder/">
  Options +Indexes +FollowSymLinks +MultiViews
  AllowOverride all
  Require local
</Directory>
But you'll still need to add the folder names to the path before entering the image file name.

'http://ServerName/myimages/image10.jpg'
'http://ServerName/myimages/folder/image357.jpg'
'http://ServerName/myimages/folder/subfolder/image789.jpg'

But if you run: 'http://ServerName/myimages/' and there is no index.php file in the folder, nor any .htaccess file that would redirect or prevent access, you'll get the list of files.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.