file_data::construct()
The constructor. Create an instance of class file_data
and create MIME file data
file_data::construct(filename)
filename
(string) — Path to file
file_data
— Returns the instance of class file_data
params = {
"file": file_data("data.txt") ' Upload a file
}
response = url.post("https://faruq.id/misc/post.php", params, true)
if response.code == 200
writeln("Upload complete!")
else
writeln(response.error_string)
endif