i have code to upload files to sql db and then to download, i have upload different type of files images and pdfs
when i download file i must spacify the type of file with this code

string filepath = @"C:\Downloads\FileName_0.pdf";

the problem is if the downloded file is not .pdf or not known for me how make the code download files without spacify the type of file, can i ?

Best Regard

The DB doesn't care that it's a file. To the DB your content is just an array of bytes. I suggest updating your table definition to include the filetype and possible the filename. That will help you write the file correctly and sort by the filetype you want.