11 Nisan 2012 Çarşamba 20:23
I would like to design a web service ( or a script embedded into a web page running on a local host) which accepts fileid as a parameter and then automatically open corresponding file in the same host.
for example if we enter http://localhost/openFile.aspx?id="JohnBrown" to browser on a windows PC, it should automatically open file JohnBrown.ppsx stored in the hard drive.
Could you guide me how to achieve this?
- Düzenleyen Uw-RfidLab 11 Nisan 2012 Çarşamba 21:07
12 Nisan 2012 Perşembe 11:46
Create the following pages to open file -
Page One = page with link to page two
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<a href="download_go.asp">Download File</a>
Page Two = page with code to get file
Dim objStream, myContents, myFileName
myFileName = "<Get the filename from querystring & add file extension>"
Response.ContentType = "application/octet-stream"
Response.AddHeader "content-disposition", "attachment; filename=" & myFileName
Set objStream = Server.CreateObject("ADODB.Stream")
myContents = objStream.ReadText
Set objStream = Nothing
14 Nisan 2012 Cumartesi 17:03ModeratörWhich hard drive? The server hard drive or the client hard drive?
WCF is Web Services. They are not two separate things.
Use WCF for All New Web Service Development, instead of legacy ASMX or obsolete WSE
Use File->New Project to create Web Service Projects
16 Nisan 2012 Pazartesi 08:24
Please clarify that where the file is located on server or client machine? I dont think there is some way by which we can open a file located on client machine.
17 Nisan 2012 Salı 14:36
This is against Security best practices and I am sure no browser will allow you to open a local file unless until security is negotiated.
You have three options.
Use Active X and prompt user to download and install your active X and from Active X you can open a file.
HTML 5 allows you to do this task up to some extent.
Ask user to upload the file to server and using a powerpoint viwer control from serverside you can show the requered ppt
Your question has nothing to do with asmx web service and we have a more dedicated forum for asp.net @ http://forums.asp.net/ where some expert can give you prompt answer.
19 Nisan 2012 Perşembe 12:10Client harddrive
19 Nisan 2012 Perşembe 12:21
So when we embed URL http://localhost/openFile.aspx?id="JohnBrown" to NFC tag, the reader will open this URL but we want to design openFile.aspx file in a way that it will take id "JohnBrown" and then open a local file defined by URL "file:///C:/JohnBrown.ppsx"