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?
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
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,
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.
Testing
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,
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.
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,
This issue should be resolved now. Please let us know if this is not the case.
Thanks,