I created a survey in vb.net where results are stored in an Excel file. Locally I can access and update the data of the file, but if I put online can not correctly access the excel file.
How can I determine the absolute url of the file so, when a user submits the answers they can be inserted correctly in the excel file?
Currently开发者_运维问答 I use this to determine the location of the file:
Dim LocalizacaoFicheiro As String = String.Concat(Server.MapPath("."), "RespostasQuestionario.xlsx")
You cannot access the file directly. Common Internet protocols like HTTP or FTP require you to download the file, update it locally and send it back. That's rather tricky to get right if multiple clients are making updates to the file, data loss is impossible to avoid.
The better mouse trap here, if not for security concerns, is to use VPN so the client can tunnel into the local network. You now only need to make the file available through a network share, the client can open the file as normal with a UNC path (like \\servername\sharename\filename
). Ask more questions about this at serverfault.com
I don't use Uris much so I don't know if this is what you're looking for but there is a AbsoluteUri
property on the Uri
class as described here.
If you're in too big of a hurry to make a VPN, use SurveyMonkey.com!
精彩评论