[Solved] Upload file to Stream always give ContentLength 0 in ASP.Net

Last Reply one year ago By rakibxl

Posted one year ago

 

Dim MemoryStream As Stream
MemoryStream = File.InputStream
MemoryStream.Position = 0

Using Parser As New PdfParser(QS.IDImportDocumentType, QS.IDProcessType)
    Json = Parser.ExtractDocumentJson(MemoryStream)
End Using

after that i can not get the length of the file

BlobStorageRequest.FileSize = File.ContentLength / 1024

 

You are viewing reply posted by: rakibxl one year ago.
Posted one year ago

You are right it has a own class ExtractDocumentJson .Thankfully i solved my problem below this code.

'Parser for making json
Using MemoryStream = New System.IO.MemoryStream
File.InputStream.CopyTo(MemoryStream)
MemoryStream.Position = 0

Using Parser As New PdfParser(QS.IDImportDocumentType, QS.IDProcessType)
Json = Parser.ExtractDocumentJson(MemoryStream)
End Using
End Using