I have an ASP page written in JavaScript that writes a CSV file into a database table.

while (!oFile.AtEndOfStream)
{
    var s = oFile.ReadLine();
    var sArr = s.split(",");

    var sPostcode = String(sArr[0]).replace(re, "");
    var sSuburb = String(sArr[1]).replace(re, "");

    ...stored procedure to write into database...
}

It works fine for smaller csv files (1,000 lines), but for larger files, it comes across a 504 error. Does anyone know a fix to this?

Help is very much appreciated.

Recommended Answers

All 2 Replies

HTTP Error 504 it's gateway timeout.

How are you trying to insert the data into the database?

You said you are using JS and ASP. The JS is reading the file and sending the data to the ASP server page to insert into the database? Is that right?
If so, then the your http request is pretty big and would take some time to complete.

Assuming you are using IIS, you can try to change the limits of the http request, like this:

<httpRuntime maxRequestLength="102400" executionTimeout="3600" />

This will set the max length to 100MB and the timeout to 60 minutes.

Increased the buffer and seems to be working.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.