added: setting a correct mime type for static files - using magic library

added: std::wstring file_mime_type to ItemContent - a mime type for static file
added: Header (core/header.h) - there will be header names defined, at the moment only content_type
added: FuncionsBase::Finish() - it is called at the end when the winix finishes
This commit is contained in:
2021-09-22 00:23:25 +02:00
parent 26ed7b80be
commit 9c5c74ba84
29 changed files with 364 additions and 35 deletions

View File

@@ -36,6 +36,7 @@
#define headerfile_winix_functions_upload
#include "functionbase.h"
#include <magic.h>
namespace Winix
@@ -61,8 +62,10 @@ private:
std::wstring path;
//DbItemQuery query;
bool is_jquery_upload;
magic_t magic_cookie;
void Init();
void Finish();
bool HasAccess(const Item & item);
bool UploadSaveStaticFile(const Item & item, const std::wstring & tmp_filename);
@@ -72,6 +75,12 @@ private:
void ResizeImage(Item & item);
void CreateThumb(Item & item);
void CreateAnswer();
void InitMagicLibIfNeeded();
void CloseMagicLib();
void AnalizeFileType(const std::wstring & file_path, std::wstring & file_type);
};