06-22-2015 08:38 AM
I was helping a user with some .NET-to-C API questions, and I tried to upload a C# source file, and got this error.
Correct the highlighted errors and try again.
The attachment's ForumExample.cs content type (text/plain) does not match its file extension and has been removed.
This can be worked around by renaming the file with a .txt extension, but this is quite an annoyance. Could one of the admins be so kind as to teach the forum software that .cs files are plaintext?
06-22-2015 09:01 AM
Another option is to just zip the file(s). But join the club. I have not been able to upload VIs for awhile now: Problems uploading a ZIP file
06-23-2015 09:46 AM
Hi Brandon,
I am unable to reproduce your issue. Is this happening to you every time you attempt to attach the .cs file? Does it happen if you attach the file to a post in this topic?
Thanks,
06-23-2015 10:06 AM
Yep, happens when trying to attach it here too.
This is with Chrome 43.0.2357.130 on Windows.
If I throw Wireshark at it, I do in fact see a multipart form segment with Content-Disposition: form-data; name="upload"; filename="ForumExample.cs" with Content-Type: text/plain when I try to post.
06-23-2015 10:17 AM
Testing
06-23-2015 10:26 AM
This issue seems to be caused by the specific environment Brandon is using. I will raise a case with Lithium to see if there's anything that can be done.
Thanks,
06-23-2015 10:31 AM
A few more details for anyone else running to this:
When you install Visual Studio, it adds a registry key that gives the MIME type for .cs files (Computer\HKEY_CLASSES_ROOT\.cs\Content Type, with value "text/plain").
Chrome picks that up and sends that MIME type along with your attachment. (Verified by modify the registry key to "text/kindaplain" and seeing that reflected in the error message).
The forum doesn't believe that "text/plain" is valid for .cs files (I'm not sure what it is expecting?), so you get the error.
06-24-2015 09:42 AM
Lithium has reproduced this issue on a machine which has Visual Studio installed. They are working to further triage this bug, so in the meantime please use the workarounds mentioned in this thread.
Thanks,
11-06-2015 09:33 AM
This issue should be resolved now. Please let us know if this is not the case.
Thanks,
09-20-2016 01:46 PM
Test of zip file.