Convert application/octet-stream file to text/plain
-
wrote on 22 Aug 2017, 12:37 last edited by
Hello,
I want to convert application/octet-stream file to text/plain.There are many web sites which can convert files into different formats on the web. Also I can convert my file through a web application but I want to do it in QT. There is a QMimeType and QMimeDatabase libraries and by the help of the libraries I can learn type of my file. But how to convert ? Thank you in advance. -
Hello,
I want to convert application/octet-stream file to text/plain.There are many web sites which can convert files into different formats on the web. Also I can convert my file through a web application but I want to do it in QT. There is a QMimeType and QMimeDatabase libraries and by the help of the libraries I can learn type of my file. But how to convert ? Thank you in advance.@aysenur
At least to me, it's completely unclear what you are trying to do.
The mime-typeapplication/octet-stream
is actually applicable for any file type since it only represents a binary data stream. So you can convert it to any file type actually. So what are you trying to to do?! -
Hi,
What conversions do you have in mind ? There's no magic wand transforming the PowerPoint document you download into a video file.
-
Hi,
What conversions do you have in mind ? There's no magic wand transforming the PowerPoint document you download into a video file.
wrote on 22 Aug 2017, 13:41 last edited byI want to convert my binary stl file to Ascii stl file(which is in plan/text format) to read it from qt and display on the screen. When I checked the properties of the files, which qt code reads, are ascii stl files but the stl files which are scanned from our 3d scanner is in application/octet-stream. I thought that when I change the mimetype of the file I can convert but this is wrong. I need to do more I think. Thank you.
-
I want to convert my binary stl file to Ascii stl file(which is in plan/text format) to read it from qt and display on the screen. When I checked the properties of the files, which qt code reads, are ascii stl files but the stl files which are scanned from our 3d scanner is in application/octet-stream. I thought that when I change the mimetype of the file I can convert but this is wrong. I need to do more I think. Thank you.
@aysenur
so you are gettingapplication/octet-stream
from querying QMimeDatabase? If so this just means that there couldn't be a related mime-type found.So you want to convert a binary STL file to a ASCII-STL file and also render it's 3D model? Well this requires that you fully understand the binary structure of binary STL files in order to do the proper conversation and the proper interpretation.
You are better off searching for a C/C++ library which does the work for you. Alternatively you may want to use a webservice to do so in your application.
But i think i am not going too far when i say that doing this all on your own is illusionary, when you already asked this question.
-
@aysenur
so you are gettingapplication/octet-stream
from querying QMimeDatabase? If so this just means that there couldn't be a related mime-type found.So you want to convert a binary STL file to a ASCII-STL file and also render it's 3D model? Well this requires that you fully understand the binary structure of binary STL files in order to do the proper conversation and the proper interpretation.
You are better off searching for a C/C++ library which does the work for you. Alternatively you may want to use a webservice to do so in your application.
But i think i am not going too far when i say that doing this all on your own is illusionary, when you already asked this question.
wrote on 22 Aug 2017, 13:59 last edited by@raven-worx Thank you for your reply. There are codes for reading stl files on github. I am not doing all staff by myself. But the files should be in plain/text format. Because when I open the stl file which is in octet stream has mixed characters. In the code for reading the triangle positions there are some beginnings and endings but in binary format there is not. Your web service offer is good I will search it and I will search for c++ .
-
wrote on 22 Aug 2017, 19:43 last edited by
@aysenur Have you read any documentation about the binary and ASCII formats for STL files? i.e. this wikipedia entry may help.
And this Ruby program may help as well in the conversion process itself, being that you run the script as an external process with QProcess, or by reading the Ruby code and writing the equivalent corresponding C++ code (at least initially you'll only needs just one part, binary to ASCII)
-
@aysenur Have you read any documentation about the binary and ASCII formats for STL files? i.e. this wikipedia entry may help.
And this Ruby program may help as well in the conversion process itself, being that you run the script as an external process with QProcess, or by reading the Ruby code and writing the equivalent corresponding C++ code (at least initially you'll only needs just one part, binary to ASCII)
wrote on 23 Aug 2017, 12:10 last edited by@Pablo-J.-Rogina Thank you. I will check ruby program.
1/8