Open Stream File
Did your computer fail to open an OCTET-STREAM file? We explain what OCTET-STREAM files are and recommend software that we know can open or convert your OCTET-STREAM files.
What is an OCTET-STREAM file?
The OCTET-STREAM format is used for file attachments on the Web with an unknown file type. These .octet-stream files are arbitrary binary data files that may be in any multimedia format. The OCTET-STREAM format was developed for Web browsers to understand that the file attachment is in an unknown file type, which also allows the user to choose to download and save the attached file in any file format that the user wants.
In other instances, the OCTET-STREAM file format is used to inform the user that the attached file may be saved in a recommended file format. This also allows the Web browser to enable the user to know the recommended file format for the attached .octet-stream file.
These OCTET-STREAM files may be opened by renaming the extension of the attached file to a specific file extension, and then by using an application with support for opening such files. For example, an .octet-stream file may be renamed to a .txt file (if it is indeed a .txt file), and Notepad may then be used to open the file. This means the user needs to know the file type of the attached .octet-stream file before renaming the file in the correct file extension.
Software that will open, convert or fix OCTET-STREAM files
Unfortunately we have not received enough suggestions for software that can open OCTET-STREAM files yet.
Try a universal file viewer
I would suggest that you try a universal file viewer like Free File Viewer. It can open over 200 different types of files - and very likely yours too! Download Free File Viewer.
By Prof. Jones (The File Expert)
Chief Content Editor and File Expert
Suggestions for this page? Mail me.
This webservice expects this xml file:
I already have the file in a stream, but this statement hangs:
the stream is a standard .net MemoryStream
what operation do I do on the stream to make it the same as File.Open?
Thanks!!
check this out (api definition):
5 Answers
I doubt that the web service really expects a stream. How on earth would it represent that? Are you sure it doesn't just expect the contents as a byte array?
File.Open
just returns a FileStream
- if stream
is already a FileStream
then there's no difference between the two. It's just possible that it wants a FileStream
whereas you've just got a Stream
. If that's the case and it's really not from a file, you'll potentially have to write it to a file and open a FileStream
to that. Then complain to the webservice developers that their API is bizarre.
EDIT: If it's only expecting a Stream
, you should be fine. You say that it hangs - have you tried debugging and seeing where exactly it's hanging? Is it trying to read more data for some reason?
Are you sure that the current position in your stream is the correct one?
The most common error i do when moving from a file stream to a memory stream is to miss that after writing to the memory stream i am at the end of it :
Have you tried putting the file content into a memory stream before assigning it? Maybe the service is using some stream features that your file stream doesn't support.
Something like this:
EDIT:
Wait... I totally misunderstood your question. So the version where you directly pass a FileStream works and if you provide a MemoryStream with the same content it doesn't?
Now I would suggest you to exactly compare the content of the memory stream with that of the file stream. Perhaps a different encoding?
File.Open returns a stream. Something else is the problem.
File.Open returns a FileStream that is open and positioned at the beginning of the stream.
The code you posted:
doesn't indicate the state of the stream you are assigning to FeedContent. E.g. maybe you aren't positioned at the start of the file? (use Stream.Seek if the stream supports seeking, which it will if it's a FileStream or MemoryStream).
Post more code if this doesn't help.