X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=api.php;h=3c0abc31138bf5c035ea1ba85a585cefbb719a53;hp=ac49d76665ca7cec11da77cad84d1b03c3bc3181;hb=5927a0dc28715b6e5ab297f1f5badd35df15a5b8;hpb=929c95de6072a424c01a74f81624008e61abbf03 diff --git a/api.php b/api.php index ac49d76..3c0abc3 100644 --- a/api.php +++ b/api.php @@ -120,11 +120,13 @@ function save_uploaded_file ($file, $con) { (!move_uploaded_file ($file ["tmp_name"], $dest))) { error_server (); } + send_to_ftp ($dest); $mini_dest = getthumbsdir () . "/mini_" . basename_safe ($dest); if (!create_thumbnail_or_copy ($dest, $mini_dest)) { error_server (); } + send_to_ftp ($mini_dest); } return basename_safe ($dest); } @@ -153,11 +155,13 @@ function delete_image_if_unused ($imgpath, $con) { $path = UPLOADDIR . "/" . $imgpath; if (file_exists ($path)) { unlink ($path); + delete_from_ftp ($path); } $thumb_path = getthumbsdir () . "/mini_" . $imgpath; if (file_exists ($thumb_path)) { unlink ($thumb_path); + delete_from_ftp ($thumb_path); } }