
request body stream exhausted” Error When Overwriting File via WebDAV Upload
Hello,
I'm using WebDAV on a cPanel server and uploading files through the Textasic app.
Issue:
When a file named 'a.html' already exists on the server, and I try to upload another 'a.html' file to the same location, I get the following error:
Error uploading 'temp/a.html': request body stream exhausted
However, if I upload a folder that includes the same file (like 'b/a.html'), I receive a prompt asking whether to overwrite the file, and the upload completes successfully.
Question:
Is this an expected behavior in the Textasic app, or is it an upload failure?
Currently, overwriting individual files does not work. If there’s any known fix or workaround, I’d appreciate the guidance.
Thank you.
https://drive.google.com/file/d/1_MRtlpzsdkaO9PF-Dt2DB7EpxgwFTPOp/view?usp=drivesdk
Customer support service by UserEcho
Thanks a lot for the video.
This is not the expected behavior. But in this case, the problem might actually be that you are trying to upload a file with a size of 0 bytes. Please try if uploading a non-empty file works.
I'll try to reproduce the problem. Maybe there is a bug when uploading empty files over WebDAV.
Hello, thank you for your response.
As per your suggestion, I conducted the test with a non-empty 4.0KB file instead of a 0-byte file. However, I am still encountering the same error:
“Error uploading "temp/a.html": request body stream exhausted”
Thus, it appears this issue isn’t confined only to empty (0-byte) files.
To clarify further, this error occurs only when uploading individual files that already exist on the server. When uploading a folder containing the same file, Textastic prompts to overwrite the existing file, and the upload completes successfully.
Please let me know if you require any additional logs or test cases—I’m more than willing to provide them.
Thank you once again for looking into this issue.
File links:
Ok, thanks for trying it out.
Since I don't currently have a cPanel server:
Would it be possible to give me a test account on the server so I can try to reproduce it with your WebDAV server?
You can send the login details to support@textasticapp.com so it isn't shown on the public feedback forum.
Update: I have tried to reproduce the problem by uploading a file to my Synology Diskstation's WebDAV server and uploading an existing file worked without problems, so it may be a problem specific to your WebDAV server software.
Hello,
Thank you very much for your help.
I’ve reviewed your comments, and I’ll also check whether there might be any configuration issues on my end, especially with the WebDAV server running on cPanel.
If needed, I’d be happy to provide a test account so you can try to reproduce the issue directly.
Please feel free to let me know if you’d like to proceed with that or if you need anything else from my side.
Thanks again for your support!
A test account would be great.
Hello,
Thank you very much for your willingness to look into this issue further.
I’ve just sent you the test login credentials via email at support@textasticapp.com.
Please refer to the email for additional notes regarding the server environment and limitations.
If you need anything else from my end, feel free to let me know.
Thank you again for your support!
Thank you! I received the email with the test account credentials. I could login and can reproduce the error.
I'll try to find out what's going on. I'll get back to you when I know more.
Hello,
Thanks again for your help.
I’ll keep the test account active for now. Please let me know once it’s no longer needed, and I’ll delete it right away.
Appreciate your continued support.
Best regards,
Jaehyun Jung
Sure, I'll let you know. Is it ok if you keep the account active for a few days? Not sure if I have time to work on it on the weekend.
Sure, no problem. I’ll keep the test account active until you confirm it’s no longer needed. Just let me know once your work is complete, and I’ll proceed with deleting it.
Thanks again!
Hi Jaehyun,
thanks again for the detailed report and for the test account. I could take a detailed look at the network traffic and found a workaround.
What’s going on
Typical WebDAV servers (Apache mod_dav, Nextcloud/SabreDAV, nginx-dav, Microsoft IIS WebDAV, and so on) keep the same TCP connection open (keep-alive): once you’ve connected to the server, all subsequent requests go through that same connection without having to authenticate again.
cPanel’s Web Disk daemon, cpdavd, on the other hand always adds "Connection: close" and shuts the socket down after every response. (It looks like this is a quirk of cpdavd and that behavior cannot be changed.)
Because of that, Textastic has to open a totally new connection for the next upload. On this fresh connection, iOS hasn’t sent the user name and password yet, so the server rejects the first attempt (returning "401 Unauthorized") and Textastic has to start the upload a second time.
Because Textastic didn’t hand iOS a fresh copy of the upload stream for that retry, the transfer aborted with "request body stream exhausted".
What’s changing
The next Textastic update hands iOS a new stream whenever cpdavd forces that retry. The upload now succeeds – although, due to the server’s behaviour, the file still travels over the wire twice on cPanel Web Disk servers.
For typical source-code-sized files the overhead is negligible, but the error message is gone and the upload completes.
Thanks for helping me track this down! If you run into anything else, just let me know.
hello! 👋,
Thank you very much for your continued support and for taking the time to investigate this issue.
I truly appreciate your efforts in identifying the cause and implementing a workaround. It’s great to hear that the upcoming Textastic update will resolve the upload problem with cPanel WebDAV servers.
Please let me know if you need any further testing or input from my side — I’d be happy to help.
Thanks again!
Would you be interested in trying a TestFlight version that includes the fix? I could prepare a TestFlight build tomorrow.
Also, I'm just reading up about the HTTP "Expect: 100-continue" header I could send which has the potential to eliminate the duplicate upload I mentioned earlier. If you could keep the test account running a little longer, I could also test this tomorrow.
Hello,
Thank you for the detailed explanation and for your continued efforts in investigating the issue.
I’ll be happy to keep the test account active a bit longer so you can test the fix with the Expect: 100-continue header and verify if it eliminates the duplicate upload. Please feel free to proceed whenever you’re ready — just let me know once you no longer need the test account.
Also, I’d be very interested in trying the TestFlight build that includes the workaround you mentioned. Please let me know once it’s ready and I’ll be glad to help test it.
Thanks again for all your support and great communication throughout this process!
Best regards,
Jaehyun Jung
I've prepared a TestFlight build that should fix the problems with uploading to cPanel WebDAV servers and also uses "Expect: 100-continue" to prevent duplicate uploads.
I've sent you a TestFlight invitation.
Please try this version and let me know if it works for you as expected.
Hello,
I’ve tested the TestFlight build you provided, and I can confirm that uploads are now working correctly with the cPanel WebDAV server.
The “request body stream exhausted” error no longer occurs when overwriting files, and the upload completes successfully.
Thank you so much for identifying the issue and implementing a fix so quickly.
Do you still need access to the test account? If not, please let me know and I’ll go ahead and remove it.
Thanks again for your continued support!
Great! Feel free to remove the test account. Thanks again!