Automatic Image Uploading

Posted on 2016-09-10
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 29

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 110

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.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 29

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 29

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 29

Accepted Solution

Olaf Doschke earned 500 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

Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

Question has a verified solution.

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

This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

617 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