[Server_Push] size) == 1; // File uploaded! var: 'temp_file_upload' = (file_uploads -> get: 1); // grab first file (only!!!) var: 'Temp_FilePath' = ($temp_file_upload -> Find:'upload.name'); // grab temp file name (on server) var: 'Temp_FileRealName' = ($temp_file_upload -> Find:'upload.realname'); // grab file name on client var: 'Temp_FileSize' = ($temp_file_upload -> Find:'upload.size'); // grab file size var: 'Temp_FileType' = ($temp_file_upload -> Find:'upload.type'); // grab mime file type // set file name of uploaded file, strip off any path no matter of / or \ platform var: 'upload_filename' = $Temp_FileRealName -> (split: '/') -> last -> (split: '\\') -> last; // Get File info; inline: -Search, -Database='cms_light', -Table='file_upload', -username = 'cms_light', -password = 't7-11.ty', 'Id'= Action_Param:'ID'; var: 'old_filename' = (Field:'File_Name'); var: 'old_folder'= (field:'Id'); /Inline; if: ($Temp_FileSize < (3*1024*1024+1) && $upload_filename==$old_filename); // File name and size OK! var: 'n1' = $old_folder % 100; var: 'n2' = $old_folder / 100; var: 'n3' = $n2 / 100; var: 'n2' = $n2 % 100; var: 'folder'= $n3 + '/' + $n2 + '/' + $n1; var: 'FolderPath' = '/cms_stuff/' + $folder + '/'; // OBS! Privileger fr Lasso var: 'FinalPath' = $FolderPath + $upload_filename; // OBS! Privileger fr Lasso var: 'ftp_u' = 'uploader2'; // ftp user var: 'ftp_p' = 'mojs7sjom'; // ftp psw var: 'server' = 'include.adm.gu.se'; // server fr ftp & web!! var: 'ftp_url' = 'ftp://' + $server + '/' + $folder + '/' + $upload_filename; // ftp url inline: -username='cms_uploader', -password='ker5.89f'; File_Control; FTP_PutFile: -URL=$ftp_url, -File=$Temp_FilePath, -Username=$ftp_u, -Password=$ftp_p; /File_Control; /inline; /if; /if; //] ?>
[if: $upload_filename == '' || $upload_filename!=$old_filename || $Temp_FileSize > (3*1024*1024)] [else] [/if]
Uppdaterat dokument/bild
Fil ej uppladdad....
[if: $upload_filename == '']Ingen fil vald.
[/If] [if: $upload_filename!=$old_filename]Ej samma filnamn som gammal fil.
[/If] [if: $Temp_FileSize > (3*1024*1024)]För stor fil. ([(integer: $Temp_FileSize) / 1024] kB)
[/If]
[if: $Temp_FileType -> (beginswith: 'image/')] [else] [$FinalPath] [/if]

Filnamn: [$upload_filename]
Filstorlek: [if: (integer: $Temp_FileSize) > 1024] [(integer: $Temp_FileSize) / 1024] kB [else] [$Temp_FileSize] bytes [/if]
File format: [$Temp_FileType]
:: Sök :: Ladda upp :: Stäng fönstret