Make sure you have a registered and verified account on the forums.
When creating your thread, click on the paperclip button shown in the image below
You will be greeted with the window shown below.
The area within the yellow square will be where all files you personally upload to the database will be stored.
Only you can see these files.
Click on 'Add Files' indicated by the red box to progress.
A sub-window will now appear indicated in the yellow square.
Click on 'Choose file' then navigate to your computers directory where your SC2 replays are saved and select the desired replay file.
This is by default set to "C:\Users\YOUR_USERNAME\Documents\StarCraft II\Accounts\YOUR_DETAILS\YOUR_SC2_ID\Replays\Multi player"
Upload the desired replay
Attach the replay to the post by clicking done!
All files to be attached to a post will be indicated in the area highlighted by the yellow rectangle.
If you are unsure that you have attached the file successfully or not, you can see what files are attached by scrolling down a bit further.
Open the second spoiler for a visual representation.