How to get the physical path or fullpath of the file in silverlight?
-
Hi all.. I ran into an issue while implementing BITS, the problem is while creating a job in BITS we have to send the local path (physical path like c:/doc/sample.txt) but Silverlight will not give us the physical path or fullpath. It says access denied. How to get the physical path or fullpath of the file in silverlight? Thanks Nitin C.N
-
Hi all.. I ran into an issue while implementing BITS, the problem is while creating a job in BITS we have to send the local path (physical path like c:/doc/sample.txt) but Silverlight will not give us the physical path or fullpath. It says access denied. How to get the physical path or fullpath of the file in silverlight? Thanks Nitin C.N
Silverlight doesn't allow access to client-side files. If you're talking about a server side file, look at the
HtmlPage.Document
object - you might be able to get it from that. What is "BITS"?.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
Silverlight doesn't allow access to client-side files. If you're talking about a server side file, look at the
HtmlPage.Document
object - you might be able to get it from that. What is "BITS"?.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.
-
Silverlight doesn't allow access to client-side files. If you're talking about a server side file, look at the
HtmlPage.Document
object - you might be able to get it from that. What is "BITS"?.45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001John Simmons / outlaw programmer wrote:
What is "BITS"?
Background Intelligent Transfer Service[^].
"WPF has many lovers. It's a veritable porn star!" - Josh Smith
As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
-
Hi all.. I ran into an issue while implementing BITS, the problem is while creating a job in BITS we have to send the local path (physical path like c:/doc/sample.txt) but Silverlight will not give us the physical path or fullpath. It says access denied. How to get the physical path or fullpath of the file in silverlight? Thanks Nitin C.N
In addition to John's answer, if you are using WCF to communicate to BITS (Im not sure what that is), you can get the path via WCF.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick - Silverlight *.XCP files. Visit the Hindi forum here.
-
Hi all.. I ran into an issue while implementing BITS, the problem is while creating a job in BITS we have to send the local path (physical path like c:/doc/sample.txt) but Silverlight will not give us the physical path or fullpath. It says access denied. How to get the physical path or fullpath of the file in silverlight? Thanks Nitin C.N
Hi Nitin, I think, I already answered your query through Twitter & my Blog. You can't get the physical path in Silverlight (assume you want the client side path). If you want server side path, it is easy to do in your server side code & return thru service call. But, as it is Silverlight, I assume, you want the path of client PC. No, you can't. There are some security reason while the application is running inside the browser sandbox. If you install it as fully trusted out-of-browser application, you can get it. Read the Article for some reference: File Explorer using Silverlight 4 COM Interoperability[^]. It may help you.
Don't forget to Click on [Vote] and [Good Answer] on the posts that helped you.
Regards - Kunal Chowdhury | Software Developer | Chennai | India | My Blog | My Tweets | Silverlight Tutorial