I have the code:
request.AddFile ("image_request[image]", ("picture.jpg");
The "image_request[image]" is required for the specific API. The "picture.jpg" is in my /resources/ folder and correctly works.
However, with my application, I do not have a file stored locally. I take a picture with the camera app and have it stored as a photo called img, which I can convert to a .jpg
My question is: How can I upload the file when I do not have a path? I simply have the .jpg image stored in a variable. RestSharp asks for a string path as the second parameter in the method AddFile, however, as stated before, I do not have a path.
I want to be able to do something like
request.AddFile ("image_request[image]", (img);
Path.GetTempFileName
Path.GetTempPath
It sounds like you may want to write the file to a temporary file, this would allow you to be in compliance with .AddFile's method signature
EDIT