I want to attach a code file to my question, but I am not able to find a link to do it. Is attaching files possible at all?

  • And yes, I'm aware that he's asking about attaching a file, but I still think the FAQ makes it clear that it should be inlined. Jul 27, 2011 at 13:17
  • People won't bother to sip through big files anyway, and those who are willing will ask you to send it to them personally via email. Jul 27, 2011 at 13:57
  • 3
    @Shadow Wizard: Don't give him the wrong ideas. Nobody on SE will do that. Jul 27, 2011 at 14:50
  • Not sure this is a duplicate of that question. Related and informative, yes, but not a dupe, IMO.
    – Jon Seigel
    Jul 28, 2011 at 4:14

2 Answers 2


You can't attach a file here, but you can post your code in the question itself. Post the code in the body of your question, select it with your mouse, then click the { } button above the edit window to format it as a code block.


If you've got a large amount of code you should consider trying to reduce it to the barest minimum that repeats the problem.

You are more likely to find people will be prepared to read a short 20 line snippet of code and help you than some class file that 500+ lines long.

  • But it would be great to post an answer in working code, unzip and go
    – k.c.
    Sep 30, 2012 at 13:51