When demo recording, then we have *.dem file, which growing (write data). You can't archive not finished (recording) demo file and upload it on server.
First of all you need to check, if this file "closed" and finished, and not opened via HLTV. After this you should compress it and upload.
Or, as stated above, record demo via AMXX and execute "compress and upload" action via AMXX, after demo file completed (recorded).