Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Automatic Image Uploading

Posted on 2016-09-10
Medium Priority
Last Modified: 2016-09-14
Hi Experts,
                 There is a repository of images on a windows PC containing 1000s of images. Some of these images, maybe 100 change everyday, which is an automatic process with no intervention.

The repository of images needs to be reflected to my server which runs PHP, SQL etc..

What I need to be able to do is to send the changes to my server.  In other words I would like to be able to send the timestamp of the local image and compare it with the timestamp of the remote version of the image, if a change has occured I would then overwrite the server version with the local version.

I dont mind opening a webpage to instigate the image updates, but what I cannot do is search for the changed images manually as that would take a very long time.

Is this possible, maybe with HTML5 or even PHP/FTP ?

Many Thanks, ChrisColeman.
Question by:ChrisColeman
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
LVL 30

Expert Comment

by:Olaf Doschke
ID: 41792640
Beyond Compare can do that, compare and sync source/target folder, even in case the target folder is a ftp url.

Bye, Olaf.

Author Comment

ID: 41792769
Olaf, Thanks and looks good - Chris.
LVL 111

Expert Comment

by:Ray Paseur
ID: 41792793
I think Beyond Compare is probably the best solution, and it's so inexpensive that it doesn't make sense to write custom software.  

From a theoretical perspective, a version control system like Git might make sense.  If I were going to design something custom, I'd look at using md5() strings for each of the files, instead of dates.  That way, only files that actually had changed content would be flagged.  Restoring a backup might change the file's date/time signature, or the server might be in a different timezone, so a message digest would seem to be a more reliable way to know what changed.
Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

LVL 30

Expert Comment

by:Olaf Doschke
ID: 41792830
File times typically are in UTC and just translated to system/locale time, but you can compare on raw filetime, where server timezones make no difference.

Beyond Compare offers comparison by content, too, eg by it's crc or binary (full) comparison, though thats obviously not saving the upload or download time.

Few ftp server support xmd5, so Beyond Compare still mainly compares on file meta data you can receive via FTP listing commands. In case you only touch files with a self developed php tool you can use MD5, of course, you can even maintain a database with a record maintaining all meta data you want or need (eg log last upload/download), but once you do manual uploads/deletes your database info is outdated. Beyond Compare rather concentrates on only comparing the files themselves without any support database. Both ways have their pros and cons.

What's perhaps a killer feature of Beyond Compare for you is that it may find similar pictures, even if you have them in different formats and sizes.

Bye, Olaf.

Author Comment

ID: 41794561
- I'm having a problem with 'Beyond Compare' because I do not wish to keep source images on the server, basically they should be deleted following reduction by PHP/GD - IE. Some of them are rather large.

I'm now thinking of something like --

A) An automated process on windows runs periodically and creates a list of files, directories and timestamps.
B) The automatic process also FTPs the list to my server.
C) On the server a DB contains vital statistics  of images currently active on the server, so I can use the uploaded list to prune deleted images

D) The problem remains to upload new and updated images. What I'm thing of is using FTP again to download a list of required new images from the server (ie. the list was prepared in C. above).

E) Once I have the downloaded list I can I can start an automatic FTP process to upload the list.
F) The newly uploaded images are then processed by PHP/GD (minimised, thumbnailed and source deleted) whenever the website is opened, by anyone.

I know its horribly convoluted - but whaat the heck ?

Any comments .. Chris.
LVL 30

Expert Comment

by:Olaf Doschke
ID: 41794587
>I do not wish to keep source images on the server
I'm a bit confused. The goal is to upload new or changed images, right?

>processed by PHP/GD (minimised, thumbnailed and source deleted)
Ah, you upload large/original scale images and shrink them serverside. Why? Because you can do it with PHP/GD? Isn't it much simpler and bandwidth friendlier to first resize, then upload?

There are so many image processing programs also on Windows, capable to batch process directories and shrink/web optimise files, why insist on doing that server side with GD?

Once you only have the web size images uploaded, no need to keep the originals merely for syncing not detecting them missing.

Bye, Olaf.

Author Comment

ID: 41794849
Actually I didn't even consider that option, probably because i was converting from a website that kep't the source images, but now its so big tht I cannot keep the source images on the server.

Actually that will save a considerable amount bandwidth and processing time too.

I have just looked at irfanview batch processing and I belive that could be what need.

Many Thanks Again - Chris.
LVL 30

Accepted Solution

Olaf Doschke earned 2000 total points
ID: 41794871
In theory, though perhaps Irfanview or Gimps script fu are better options, you could even install PHP client side and use your GD processing.

Bye, Olaf.

Author Comment

ID: 41797466
Yes I did consider PHP client side because I already have that, but the client I'm working for does not and it would be a problem for him.

Actually I'm developing this for a disabled person who has diffficulty uploading photos therefore I need to make it seamless as possible.

Hopefully all he needs to do now (or when its complete) is connect up his camera ..

Gimps script fu seems pretty good too.


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question