winix/functions/upload.h

59 lines
1.1 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010-2013, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfile_winix_functions_upload
#define headerfile_winix_functions_upload
#include "functionbase.h"
#include "space/spacetojson.h"
namespace Fun
{
class Upload : public FunctionBase
{
public:
Upload();
bool HasAccess();
void MakePost();
void MakeGet();
void UploadFile(Item & item, const std::wstring & tmp_filename);
private:
std::wstring path;
std::string patha, path_thumba;
DbItemQuery query;
bool is_jquery_upload;
// this object is used in App at the end of a request
// for serializing Request::info to JSON
// this will make a problem if in the future we'll use multithread requests
PT::SpaceToJSON json_serializer;
void Init();
bool HasAccess(const Item & item);
bool UploadSaveStaticFile(const Item & item, const std::wstring & tmp_filename);
bool FunUploadCheckAbuse();
void UploadMulti();
void UploadSingle();
void ResizeImage(Item & item);
void CreateThumb(Item & item);
void CreateAnswer();
};
} // namespace
#endif