|
@@ -62,7 +62,7 @@ class Http {
|
|
|
public var responseHeaders : haxe.ds.StringMap<String>;
|
|
|
var chunk_size : Null<Int>;
|
|
|
var chunk_buf : haxe.io.Bytes;
|
|
|
- var file : { param : String, filename : String, io : haxe.io.Input, size : Int };
|
|
|
+ var file : { param : String, filename : String, io : haxe.io.Input, size : Int, mimeType : String };
|
|
|
#elseif js
|
|
|
public var async : Bool;
|
|
|
#end
|
|
@@ -353,12 +353,12 @@ class Http {
|
|
|
Note: Deprecated in 4.0
|
|
|
**/
|
|
|
@:noCompletion
|
|
|
- inline public function fileTransfert( argname : String, filename : String, file : haxe.io.Input, size : Int ) {
|
|
|
- fileTransfer(argname, filename, file, size);
|
|
|
+ inline public function fileTransfert( argname : String, filename : String, file : haxe.io.Input, size : Int, mimeType = "application/octet-stream" ) {
|
|
|
+ fileTransfer(argname, filename, file, size, mimeType);
|
|
|
}
|
|
|
|
|
|
- public function fileTransfer( argname : String, filename : String, file : haxe.io.Input, size : Int ) {
|
|
|
- this.file = { param : argname, filename : filename, io : file, size : size };
|
|
|
+ public function fileTransfer( argname : String, filename : String, file : haxe.io.Input, size : Int, mimeType = "application/octet-stream" ) {
|
|
|
+ this.file = { param : argname, filename : filename, io : file, size : size, mimeType : mimeType };
|
|
|
}
|
|
|
|
|
|
public function customRequest( post : Bool, api : haxe.io.Output, ?sock : AbstractSocket, ?method : String ) {
|
|
@@ -419,7 +419,7 @@ class Http {
|
|
|
b.add(file.filename);
|
|
|
b.add('"');
|
|
|
b.add("\r\n");
|
|
|
- b.add("Content-Type: "+"application/octet-stream"+"\r\n"+"\r\n");
|
|
|
+ b.add("Content-Type: "+file.mimeType+"\r\n"+"\r\n");
|
|
|
uri = b.toString();
|
|
|
} else {
|
|
|
for( p in params ) {
|