Catch insects: DateToStr

Source: Internet
Author: User

Another error occurs. The appearance is always so confusing.

Some customers say the file upload service is unavailable. The error message is a server error. But other machines can, it means that the service itself is not a big problem, or the error occurs, because the client environment is different. There is nothing wrong with drawing a conclusion.

What is the client environment? This is a very interesting process.

First, the file upload service published an address http: // myServer/upload. aspx. Submit the local file data during Post. Resumable upload is supported, so each file generates a unique ID.

We used HttpAnalysis to understand the differences in the entire Post process. This tool can track all Http request processes. The comparison shows that the request headers of the client that successfully uploads the file are no different from those of the failed client. We tried to simulate the request data of the client that successfully uploaded the file on the failed client machine and found that there was no problem. The problem will inevitably occur in data submission.

After careful comparison, we found that the data was actually faulty. It turns out that the file upload service needs to obtain the file creation date. At that time, the author implemented the conversion to a string using DateToStr (Delphi. The server then converts the string. As you know, DateToStr is converted based on the local short date setting format. If the local setting is inconsistent with the server setting, reverse resolution may not be supported.

When we set the time format of the machine that failed to open the file to upload, the original format is as follows: "yyyy-mm-dd-Week", after a week, the server cannot identify it. Okay. Now that you know the error, you can change it.

In conclusion, we found that this problem has long occurred. Why? There should be static analysis tools to leave these experiences behind, and they will not be forgotten due to personnel changes in the future.

After that, someone may ask, isn't it easier to directly debug the server? Yes, but since the server is not compiled by ourselves, we just borrow the ready-made services from others, so there are many ways to design it.

This article from "Han Xiaoming's blog" blog, please be sure to keep this source http://xiammy.blog.51cto.com/3301816/605100

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.