I'm trying to upload a file via WCF service. I can upload a file as a Stream
but I need also a file name.
For test purpose, I've created a simple form with <input type='file' />
tag.
According to the article (http://www.codeproject.com/Articles/166763/WCF-Streaming-Upload-Download-Files-Over-HTTP) there is a class:
[MessageContract]
public class RemoteFileInfo : IDisposable
{
[MessageHeader(MustUnderstand = true)]
public string FileName;
[MessageHeader(MustUnderstand = true)]
public long Length;
[MessageBodyMember(Order = 1)]
public Stream FileByteStream;
public void Dispose()
{
if (FileByteStream != null)
{
FileByteStream.Close();
FileByteStream = null;
}
}
}
and now - how to pass the file value (from that input
tag) to that class ?