Hi all
i am trying to retrieve media file duration brfore uploading to the server.
to upload the file m using fileupload control.
m using class file for this.
aspx file code is ashown below
MP3Header mp3hdr = new MP3Header();bool boolIsMP3 = mp3hdr.ReadMP3Information(Filename);
{
if
(boolIsMP3)
{
Response.Write("Filename:");
Response.Write(strFileName);
}
}
and class file is as shwon below
public bool ReadMP3Information(string FileName)
{
FileStream fs = new FileStream(FileName, FileMode.Open, FileAccess.Read);
// Set the filename not including the path information
strFileName = @fs.Name;
char[] chrSeparators = new char[] { '\\', '/' };
string[] strSeparator = strFileName.Split(chrSeparators);int intUpper = strSeparator.GetUpperBound(0);
strFileName = strSeparator[intUpper];
// Replace ' with '' for the SQL INSERT statementstrFileName = strFileName.Replace("'", "''");
// Set the file size
lngFileSize = fs.Length;
byte[] bytHeader = new byte[4];
byte[] bytVBitRate = new byte[12];
int intPos = 0;
......
....
}
it is displaying the error "file not found".
if i use the same code in the aspx page itself,its working fine.
if any one knows the slution please let know how to use this class file and what parameter need to pass.