5. dubna 2012 8:00
I want to get the server path of VHD drive. I am working on azure web application. I have some files uploaded and saved it in to the Test.VHD drive (say). This is a cloud drive inside some blob container "drives" (say). I mounted and mapped it by following way:
driveLetter = drive.Mount(localCache.MaximumSizeInMegabytes - 20, DriveMountOptions.Force);
window.open(pdfPath, pdfName, 'scrollbars=yes, resizable=yes');
My question is what do I have to pass as a "pdfPath" parameter?
I have the path "A:\Uploads\<pdf name>.pdf". But I can't pass it. I have to pass it like http://servername:port/path so that user can view it.
But I don't know how to convert it to the link like http://servername:port/path. By doing this I can view the pdf in the browser.
Please help me,
Thanks in advance.
- Upravený BhimrajG 5. dubna 2012 8:07 corrected
5. dubna 2012 12:35
You can't directly link to the file on the drive. You'll need to write code that servers the file in the HTTP response.
- You could use an HttpHandler to serve the file: http://dodgethecode.blogspot.com/2008/09/large-file-download-using-httphandler.html
- If you work with ASP.NET MVC you could use the FileResult: http://dotnet.dzone.com/news/goodbye-http-handler-hello
Hope this helps.
Sandrino Di Mattia | Twitter: http://twitter.com/sandrinodm | Azure Blog: http://fabriccontroller.net/blog | Blog: http://sandrinodimattia.net/blog