fixed crash that occurred when trying to post a document through a web request but the server can't write the file to disk