I want to read a CSV file and put the data into an ArrayList. I use HtmlInputFile. It works fine when the user browse for the file and select the file. It works fine when I test this local on my machine.
But when I test it at the webserver, the filename refer to (for example) C:\myFile.csv but at the server and not the client.
I want to read the csv file, validate that it is correct and then save the data into a database.
<INPUT id="inputFileName" type="file" runat="server">
protected HtmlInputFile inputFileName;
private void btnValidateFile_Click(object sender, System.EventArgs e)
if( inputFileName.PostedFile != null )
// Output no fileName...
protected void LoadFromFile(string _fileName)
ArrayList RecordList = new ArrayList();
StreamReader cr = new StreamReader(_fileName)
while (cr.Peek() >=0)
string tempString = cr.ReadLine();
recordCollection = tempString.Split(';');