X-Git-Url: https://dev.renevier.net/gitweb.cgi?p=syp.git;a=blobdiff_plain;f=api.php;h=302c1c75461376ad8c56889e9e84ed85327be913;hp=2054350084a29108e54982d3de468354805b33da;hb=80e63e12e3043d7164c35c4babd830dd969cd212;hpb=3a6fe9050638cf25ad42f31e99cc6d2d0b10398c diff --git a/api.php b/api.php index 2054350..302c1c7 100644 --- a/api.php +++ b/api.php @@ -98,11 +98,13 @@ function save_uploaded_file ($file, $con) { (!move_uploaded_file ($file ["tmp_name"], $dest))) { server_error (); } + send_to_ftp ($dest); $mini_dest = getthumbsdir () . "/mini_" . basename_safe ($dest); if (!create_thumbnail_or_copy ($dest, $mini_dest)) { server_error (); } + send_to_ftp ($mini_dest); } return basename_safe ($dest); } @@ -131,11 +133,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); } }