diff --git a/content/upload.cpp b/content/upload.cpp index 138b145..a0ccf0f 100755 --- a/content/upload.cpp +++ b/content/upload.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include "content.h" #include "../core/request.h" #include "../core/data.h" @@ -64,9 +66,20 @@ struct stat sb; } else { + int err = errno; + // !! skasowac takze plik z bazy danych - log << log1 << "Content: can't move the tmp file from: " << tmp_filename; - log << log1 << ", to: " << path << logend; + log << log1 << "Content: can't move the tmp file from: " << tmp_filename; + log << log1 << ", to: " << path; + log << log1 << ", errno: " << err; + + const char * err_msg = strerror(err); + + if( err_msg ) + log << log1 << ": " << err_msg; + + log << logend; + request.status = Error::permission_denied; } }