Fixed some FT stuff
This commit is contained in:
parent
55f3f7656a
commit
53d3814f92
@ -113,7 +113,7 @@ namespace _transfer {
|
|||||||
if(data.size != this.transfer_key.total_size)
|
if(data.size != this.transfer_key.total_size)
|
||||||
throw "invalid size";
|
throw "invalid size";
|
||||||
|
|
||||||
throw "files arent yet supported";
|
buffer = native.ft.upload_transfer_object_from_file(data.path, data.name);
|
||||||
} else if(typeof(data) === "string") {
|
} else if(typeof(data) === "string") {
|
||||||
if(data.length != this.transfer_key.total_size)
|
if(data.length != this.transfer_key.total_size)
|
||||||
throw "invalid size";
|
throw "invalid size";
|
||||||
|
@ -178,7 +178,16 @@ void TransferObjectWrap::do_wrap(v8::Local<v8::Object> object) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TransferFileSource::TransferFileSource(std::string path, std::string name) : _path{std::move(path)}, _name{std::move(name)} { }
|
TransferFileSource::TransferFileSource(std::string path, std::string name) : _path{std::move(path)}, _name{std::move(name)} {
|
||||||
|
if(!this->_path.empty()) {
|
||||||
|
if(this->_path.back() == '/')
|
||||||
|
this->_path.pop_back();
|
||||||
|
#ifdef WIN32
|
||||||
|
if(this->_path.back() == '\\')
|
||||||
|
this->_path.pop_back();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define u8path path
|
#define u8path path
|
||||||
|
Loading…
x
Reference in New Issue
Block a user