index_rawcontent.html, index_ajaxcontent.html now we have out_streams in Request and some special keyword in ezc templates for sending content to the specified streams changed: the way how winix answers to the client's browsers: info from Request class: winix answer send to the client's browser | | depending on send_bin_stream ------------------------------------------------- | | text answer binary answer | | depending on return_json sending out_bin_stream ------------------------------------ | | normal request ajax request | | sending out_streams[0] depending on return_info_only ------------------------------------------------------ | | generating JSON object from: generating JSON object only from info out_streams and info, e.g.: e.g.: { { info object serialized here } "stream_1": "some html content", "stream_2": "some other html content", "info": { info object serialized here } } note that out_streams[0] is not sent in JSON answers git-svn-id: svn://ttmath.org/publicrep/winix/trunk@937 e52654a7-88a9-db11-a3e9-0013d4bc506e
59 lines
1.1 KiB
C++
Executable File
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
|