D-Link Forums

The Graveyard - Products No Longer Supported => IP Cameras => DCS-930L => Topic started by: TD99 on March 24, 2011, 01:21:57 PM

Title: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: TD99 on March 24, 2011, 01:21:57 PM
If you're like me, you've probably installed your cameras by now and have them sending up images to an FTP server either on a schedule or when motion is detected (I use the latter). But the problem is: "How do I easily view the images using my web browser?"

Sure, you could view them one at a time by going to "http://www.mysite.com/folderwithimages", but I wanted a FAST and FREE way to view a gallery of thumbnails of the captured images.

Well, I did some research and found a pretty good solution which I will walk you through below (yeah, I'm an engineer and tech writer by trade, so I like documenting cool finds and then sharing them with others).

The following does require a little technical know-how in terms of web servers, etc. but I'll try to be as descriptive as possible.

And now, the solution: phpAlbum.net

It is an Open Source PHP script which allows you to create your personal Photo Album / Gallery in just a few seconds. All you need is a web space with FTP access. No database is needed. After a few clicks with the phpAlbum.net Installer you are ready to upload your photos, create new directories /galleries, and use your photo album.

Since the site has an installer, I was up and running in minutes.

Read all about it and run the installer here:
http://www.phpalbum.net/ (http://www.phpalbum.net/)

Tip: Before you get started, you should confirm that your web hosting provider supports PHP 5 (chances are that they all do, but you never know.)

The basic steps are:

1. Pick a folder on your web server which will house the phpAlbum files.
2. Installed phpAlbum to that folder.
3. Configure your cameras to upload the images to the "photo" folder that phpAlbum creates.
4. Enjoy the online gallery!

For my example, we will be using the website "www.mysite.com" which you will replace with your own domain name.

The first thing I did was log into the control panel of my web server's hosting provider and created a new subdomain name called "security". That way, I could go to "http://security.mysite.com" to view the captured images. Once I did this, a new folder called "security" was automatically created on my web server.

Next, I created a temporary FTP user account solely for the purpose of installing phpAlbum (tip: avoid using your site's administrator account whenever possible). I gave the new account a default access folder location of "/www/security". That way, when I connect to the FTP server using that new account, the default "root" folder will be the "security" folder.

Once that was done, I went to the phpAlbum installer page (http://www.phpalbum.net/node/22) where I entered the name of my FTP server (ftp.mysite.com), the temporary user name I had created and the password. I also made sure that I set the default folder to just "/" which as stated above, is really the "security" folder. If I had left that install path as the default then it would have created a subfolder called phpAlbum which is not good because that means I would have to go to "http://security.mysite.com/phpAlbum" in order to view the gallery.

When the install was done, I deleted the temporary FTP user account created earlier.

Using FileZilla, I connected to my FTP server (ftp.mysite.com) so I could see and work with the folders that phpAlbum had created. The folder you are mostly concerned with is the one called "photos_XXXXXXXX" where "XXXXXXXX" is a unique random number created for your particular install. This is to keep hackers and nosy people for guessing where your images are directly stored.

Since I have four cameras, in FileZilla I manually I created four new subfolders within the "photos_XXXXXXXX" folder called:


(http://img827.imageshack.us/img827/6347/folderstructure.png)

I then went into each camera's settings and changed the upload folder to the appropriate one. For example, for my DCS-930L, under Setup > FTP, in the FTP Server section, I changed the path for the driveway camera to "/www/security/photos_XXXXXXXX/driveway" (again where "XXXXXXXX" is my particular unique folder name).

Also within Time Schedule section, I have "Enable uploading images to the FTP server" box checked. "Motion Detection" is selected. For the "Base file name", I put "Driveway_" but this is not mandatory; it just adds that to beginning of each file when created.

In the "File" section, I selected "Date/Time Suffix" and checked the box "Create subfolder by". I selected "1 day" from the drop-down menu. The beauty of this is that every day a new subfolder will be created (see above screenshot) which in turn will create a new sub-gallery in phpAlbum when phpAlbum scans all the folders for updates.

I then repeated the process for my other 3 cameras making sure that each was uploading to a unique path.

(http://img7.imageshack.us/img7/1131/timeschedule.png)

Once I did all this, I tested phpAlbum by going to http://security.mysite.com and voila! It displayed 4 galleries, one for each camera. Then I spent about 15 minutes configuring the app in the "Setup" section and getting familiar with it. I customized a ton of things like the site's name, theme, colors, layout, having it display the newest images automatically, as well as locking down the main screen so that a login was required in order to view anything.

Setup and configuration tips for phpAlbum.net

Well, that's pretty much it. So far, I have been VERY satisfied with phpAlbum's performance. I have also accessed my site with the web browser on my Android phone. Looks great.

If you have any questions, tips, or suggestions, please post them here.

Thanks!

Here are some screenshots of my site:

Main Gallery
Note how the newest images from all cameras appear on this page
(http://img98.imageshack.us/img98/8048/securitycams.png)

"Guest Bedroom" Gallery
Notice the time-stamped sub-galleries on the left sorted by newest first
(http://img856.imageshack.us/img856/5047/securitycams2.png)
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: trscons on March 29, 2011, 06:24:55 AM
What a great tutorial! While I haven't tried on my own site(s) yet, the setup and outcomes look very good. Thanks for the effort to write this up.
Tom  :)
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: acellier on April 01, 2011, 03:31:05 PM
Sounds nice! And how do you keep the server from getting filled up? Does the php have a "delete after x days" option?
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: TD99 on April 03, 2011, 10:03:08 AM
I manually go in and delete folders, but with just the 1GB of storage I get online, it would take some time to fill up.

Images average 35k each, so that's about 28,500 images.
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: TD99 on April 07, 2011, 03:19:25 PM
Update: I've been looking at other phpAlbum solutions online and found one that very basic and VERY simple to install. In fact, it's just ONE file that you upload.

Single File PHP Gallery 4.1.0
http://sye.dk/sfpg/ (http://sye.dk/sfpg/)

It lacks many of the features found in the phpAlbum.net solution I originally posted about such as logins, most recent photos, etc, but if all you're looking for is a simple, basic solution, this is it.

All you have to is place the single index.php file in a folder, and then all your images in subfolders. It takes care of the rest.

Here's the main HOME screen:
(http://img691.imageshack.us/img691/8654/sfpg1.png)

When I click on the [DRIVEWAY] gallery:
(http://img135.imageshack.us/img135/7259/sfpg2.png)

And when I select a date sub-gallery from there:
(http://img146.imageshack.us/img146/9923/sfpg3.png)

Again, very simple. Fast. And FREE.
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: mrsr71 on May 18, 2011, 04:23:55 PM
Update: I've been looking at other phpAlbum solutions online and found one that very basic and VERY simple to install. In fact, it's just ONE file that you upload.

Single File PHP Gallery 4.1.0
http://sye.dk/sfpg/ (http://sye.dk/sfpg/)

It lacks many of the features found in the phpAlbum.net solution I originally posted about such as logins, most recent photos, etc, but if all you're looking for is a simple, basic solution, this is it.

All you have to is place the single index.php file in a folder, and then all your images in subfolders. It takes care of the rest.

Here's the main HOME screen:
(http://img691.imageshack.us/img691/8654/sfpg1.png)

When I click on the [DRIVEWAY] gallery:
(http://img135.imageshack.us/img135/7259/sfpg2.png)

And when I select a date sub-gallery from there:
(http://img146.imageshack.us/img146/9923/sfpg3.png)

Again, very simple. Fast. And FREE.

I followed all of the instructions but, how do you view the images  ??? ???

Do I need to construct a web page  ??? ???
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: TD99 on May 18, 2011, 04:58:25 PM
I followed all of the instructions but, how do you view the images  ??? ???

Do I need to construct a web page  ??? ???

You need to enter the full address of the gallery in your web browser.

For example, if your website is "www.foo.com" and your gallery is stored in a folder called "pics" on that web server, you need to go to "www.foo.com/pics".
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: mrsr71 on May 18, 2011, 05:36:10 PM
You need to enter the full address of the gallery in your web browser.

For example, if your website is "www.foo.com" and your gallery is stored in a folder called "pics" on that web server, you need to go to "www.foo.com/pics".

This is all I get so it must be an Earthlink issue(?)

(http://home.earthlink.net/~nuke_em/D-Link%20Gallery.jpg)
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: TD99 on May 19, 2011, 08:37:15 AM
This is all I get so it must be an Earthlink issue(?)

(http://home.earthlink.net/~nuke_em/D-Link%20Gallery.jpg)

Which folder is the "index.php" file in?
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: mrsr71 on May 19, 2011, 08:50:17 AM
Which folder is the "index.php" file in?

It's in the "PHP Gallery" folder.
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: TD99 on May 19, 2011, 09:14:06 AM
Then you need to enter your website's URL plus the "PHP Gallery" folder. Although I don't recomend using a space. Rename the folder to use an underscore instead.

www.yourwebsite.com/php_gallery
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: mrsr71 on May 19, 2011, 09:32:36 AM
Then you need to enter your website's URL plus the "PHP Gallery" folder. Although I don't recomend using a space. Rename the folder to use an underscore instead.

www.yourwebsite.com/php_gallery

I did exactly as you said and it's still doesn't work. I betcha is a Earthlink server issue. Oh well, the D-Link software still works well.
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: JavaLawyer on May 20, 2011, 05:31:49 AM
Did you search Earthlink technical support for any special conditions or requirements for executing PHP scripts?  Depending on the scripting language, some providers require actively enabling the scripting functionality on the admin back-end or have special naming/pathing conventions.

If you're paying an annual hosting fee, then you may have some level of telephone support for technical questions.
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: TD99 on October 05, 2011, 04:50:23 PM
Can we move this topic to the DCS-930L thread? That's what I intended it for.
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: JavaLawyer on October 05, 2011, 05:23:46 PM
Can we move this topic to the DCS-930L thread? That's what I intended it for.

Sure. . .
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: Kyyyyyy on September 22, 2013, 10:34:47 AM
Hey, can you please let me know how you made PHPAlbum refresh more than every 24 hours?

 I tried your second link as well (single file php album) and it didn't work with my web host (1&1) :(


Thanks for the awesome write up! :D
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: Notworried on September 22, 2013, 05:31:38 PM
Where do you get free FTP server these days? I am getting pics emailed to me but that is very disruptive.
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: schwieb on October 22, 2013, 12:34:47 PM
For what it's worth, I've created a simple bash script to delete the folders over a certain age.  This script will work with the 'Single file PHP Galery' setup. All you need to do is set the path to your uploaded images and _sfpg_data directories.  I used cron to execute this script every night at midnight.
-R

Code: [Select]
#!/bin/bash

#Set deletion interval (x days ago).
daysago=`date -d "10 days ago" +%Y%m%d`

#Set directory path 
dir=/home/html/webcam

#Set SFPG data directory path
sfpg=/home/html/webcam/_sfpg_data

#The Delete Script
for dirs in "$dir"/*/
do
 if [[ "$dirs" != "$sfpg"/ ]]
 then
   cam=`basename $dirs`
   cd $dirs
for backup in [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
do
       if test "$backup" -lt "$daysago"
       then
      #echo $dirs$backup
      rm -rf $dirs$backup
      #echo $sfpg/info/$cam/$backup
      rm -rf $sfpg/info/$cam/$backup
      #echo $sfpg/thumb/$cam/$backup
      rm -rf $sfpg/thumb/$cam/$backup
       fi
done
 fi
done
Title: Re: DIY: How to easily view your FTP'd images in a gallery using your web browser
Post by: RYAT3 on October 22, 2013, 02:54:36 PM
Where do you get free FTP server these days? I am getting pics emailed to me but that is very disruptive.

iusbport ?

filezilla server?