disp('ftp to EOL site, ucar')
clear dir
% write some files to ftp://data.eol.ucar.edu/pub/incoming/stratus/
jd=num2str(ddd);

tmw=ftp('data.eol.ucar.edu','anonymous','ludovic.bariteau@noaa.gov');
dir(tmw)
binary(tmw);  %set FTP transfer type to binary

cd(tmw,'pub/incoming/stratus');
dir(tmw)

% mkdir(tmw,['flux/day', jd]);
% cd(tmw,['flux/day', jd]);
% delete(tmw,'*.*');

try
   mput(tmw,[way_proc_data_flux, '*', jd, '*.txt']);
   mput(tmw,[way_images_flux, '*', jd, '*.jpg']);
catch
    disp(['Files present in', c])
    dir(tmw)
    error('Files already uploaded on the server.')
end;

dr=dir(tmw,['*', jd, '*.*']);
disp('  ');
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');
dir(tmw,['*', jd, '*.*'])
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');
disp(['     <<<<<<<<  Number of files transfered: ', num2str(length(dr)), '    >>>>>>>>>>>>>>>']);
disp('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%');

close(tmw);
clear tmw