Following is the MATLAB Code for establishing connection with remote FTP Server and uploading image files to this Server.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
main_path='C:\Users\Dell\Downloads\TakeVideoTakeVideoframes'; mov_path='C:\Users\Dell\Downloads\TakeVideoTakeVideoframes2'; if ~exist(mov_path, 'dir') mkdir(mov_path); end; a=dir(main_path); f = ftp('ftp.servername.com','uname','pass'); cd(f,'matlab'); k = 1; while ~isempty(a) fullfilename = [main_path int2str(k) '.png']; %movfullfname = [mov_path int2str(k) '.png']; disp(fullfilename); x=exist(fullfilename,'file'); if x > 0 x=1; end; if x temp=0; mput(f,fullfilename ); movefile(fullfilename,mov_path); end; k = k+1; end; |