Automate transfer of incoming files to another folder?

itm

itm

Associate
Joined
22 Feb 2011
Posts
199
I've just bought a Fuji camera which has an auto-upload feature. The problem is that it will only upload to a local drive on the host (WIndows 7) PC, whereas my photos are all stored on a NAS. I've had to set up a local folder specifically to allow uploads from the camera.
What's the best way of automating a process to monitor this folder and automatically transfer uploaded files to a network share? Ideally I'd like this to happen in close to real time, rather than having a scheduled script for example.
 
have you tried mapping the network folder to a drive letter. I've got my nas 'video' folder mapped to a letter and it acts like a normal drive/folder albeit slower
 
have you tried mapping the network folder to a drive letter. I've got my nas 'video' folder mapped to a letter and it acts like a normal drive/folder albeit slower

Yes I have it mapped as my P: drive but the Fuji software was too smart to be fooled by the drive mapping :(
 
I've not tried it with a network share but you could make a directory junction - this may trick their software into thinking it's part of the local drive.

eg. (run from CMD with admin)
Code:
mklink /d "C:\Photos" "\\servername\share name"
 
I've not tried it with a network share but you could make a directory junction - this may trick their software into thinking it's part of the local drive.

eg. (run from CMD with admin)
Code:
mklink /d "C:\Photos" "\\servername\share name"

Thanks for the suggestion - that didn't fool it either :(
 
a decent FTP batch file ?

Something like this that will only upload new incoming photographs? you could then edit it a bit more to delete all files that were uploaded to the local drive by the camera....... bit of a pig solution but it should work

@Echo Off
Setlocal Enabledelayedexpansion

REM -- Define File Filter, i.e. files with extension .txt
Set FindStrArgs=/E /C:".txt"

REM -- Extract Ftp Script to create List of Files
Set "FtpCommand=ls"
Call:extractFileSection "[Ftp Script 1]" "-">"%temp%\%~n0.ftp"
Rem Notepad "%temp%\%~n0.ftp"

REM -- Execute Ftp Script, collect File Names
Set "FileList="
For /F "Delims=" %%A In ('"Ftp -v -i -s:"%temp%\%~n0.ftp"|Findstr %FindStrArgs%"') Do (
Call Set "FileList=%%FileList%% "%%A""
)

REM -- Extract Ftp Script to upload files that don't exist in remote folder
Set "FtpCommand=mput"
For %%A In (%FileList%) Do set "Exist["%%~A"]=Y"
For /F "Delims=" %%A In ('"dir /b "%localdir%"|Findstr %FindStrArgs%"') Do (
If Not defined Exist["%%~A"] Call Set "FtpCommand=%%FtpCommand%% "%%~A""
)
Call:extractFileSection "[Ftp Script 1]" "-">"%temp%\%~n0.ftp"
rem Notepad "%temp%\%~n0.ftp"

For %%A In (%FtpCommand%) Do Echo.%%A

REM -- Execute Ftp Script, download files
ftp -i -s:"%temp%\%~n0.ftp"
Del "%temp%\%~n0.ftp"
GOTO:EOF


:extractFileSection StartMark EndMark FileName -- extract a section of file that is defined by a start and end mark
:: -- [IN] StartMark - start mark, use '...:S' mark to allow variable substitution
:: -- [IN,OPT] EndMark - optional end mark, default is first empty line
:: -- [IN,OPT] FileName - optional source file, default is THIS file
:$created 20080219 :$changed 20100205 :$categories ReadFile
:$source http://www.overclockers.co.uk
SETLOCAL Disabledelayedexpansion
set "bmk=%~1"
set "emk=%~2"
set "src=%~3"
set "bExtr="
set "bSubs="
if "%src%"=="" set src=%~f0& rem if no source file then assume THIS file
for /f "tokens=1,* delims=]" %%A in ('find /n /v "" "%src%"') do (
if /i "%%B"=="%emk%" set "bExtr="&set "bSubs="
if defined bExtr if defined bSubs (call echo.%%B) ELSE (echo.%%B)
if /i "%%B"=="%bmk%" set "bExtr=Y"
if /i "%%B"=="%bmk%:S" set "bExtr=Y"&set "bSubs=Y"
)
EXIT /b


[Ftp Script 1]:S
!Title Connecting...
open example.com
username
password

!Title Preparing...
cd public_html/MyRemoteDirectory
lcd c:\MyLocalDirectory
binary
hash

!Title Processing... %FtpCommand%
%FtpCommand%

!Title Disconnecting...
disconnect
bye
 
a decent FTP batch file ?

Something like this that will only upload new incoming photographs? you could then edit it a bit more to delete all files that were uploaded to the local drive by the camera....... bit of a pig solution but it should work

Presumably this would need to run on a scheduled basis? (I was hoping for something that could be triggered by the arrival of a file, rather than needing to run perpetually on a schedule)
 
You could write something that triggered on the arrival of a new file....... but it will copy the files that aren't on the storage server following a upload (again tho most FTP's need to be scheduled better for it to do its self tho is it not even if the batch file is only run every 10 mins?).
 
Back
Top Bottom