Sherif Kamel wrote:
Well , you guided me to the way. I've searched for the HTTP requests and came up with a code that enabled the connection to the text file normally. Thanks a lot.
But what about excel file sheet ? can I read it's data the same way?
Not quite the same way, but…
I would advise to use Microsoft Open XML SDK. I hope your files are not of obsolete and proprietary .xls format, but in .xlsx format based on the international ISO/IEC 29500:2008 standard and publicly available ECMA-376 standard:
http://en.wikipedia.org/wiki/Office_Open_XML.
Please see my past answers referenced in this one:
How to add microsoft excel 15.0 object library from Add Reference in MS Visual Studio 2010.
See also this CodeProject article:
Creating basic Excel workbook with Open XML.
Sorry, it is devoted to the creation of a workbook, but it can give you the general idea.
[EDIT]
Note that on the server side you can do different things. You can host the files and simply present them using HTML
anchors. But you can compose the files on the fly out of some data and provide them on request. In case of ASP.NET, you can do it using the same very Open XML SDK mentioned above (and, in this case, the CodeProject article I referenced would be the very it).
The key here is to set correct
ContentType
of you
HttpResponse
. These types are strings supported by IANA:
http://www.iana.org/assignments/media-types/media-types.xhtml,
http://www.iana.org/assignments/media-types/media-types.xhtml#application.
See also:
http://en.wikipedia.org/wiki/Internet_Assigned_Numbers_Authority.
—SA