I'm on the verge of doing something silly and I hope the SL team can save me from doing so, and my peer developers can pitch in... :D
When I first found out Silverlight supports OpenFileDialog, I felt this could be significant since it brings web-app closer to desktop-app (and even a competitive advantage over Flash). But the lack of the complimentary SaveFileDialog really makes it a
rather moot point, at least less relevant.
But now Flash 10 is out and they support both OpenFileDialog and SaveFileLog, so it is silly to continue to say why SL shouldn't support it in the name of "security". IMO SL should support it ASAP, hopefully no later than 2.1. This feature, though small,
gives Flash tremendous inroad into the desktop space without going through AIR (which seems bloated to me).
In my SL app, I already uses LoadFileDialog but the lack of SaveFileDialog drives me crazy... Now I am thinking about having both SL2 and Flash 10 in my application, and when I need to save something, I pipe the data to Flash 10 and do it there. For consistency
reason I may move OpenFileDialog to Flash 10 as well. Only thing that stops me from doing so is that I hate Flash development, but I guess sometimes need trumps over desire.
This is really silly... I wish I don't have to go this route... "Here's a great SL app, oh but to run it you need both SL2 and Flash10!"
Visit http://www.tagxedo.com, a Silverlight-based word cloud generator. If you like it, please help me spread the word!
Funny, I was just about to write a post about this topic. Glad I scanned the forum first.
I wholeheartedly second this request for SaveFileDialog. When I look at the way the IsolatedStorage is implemented, I see that the SL team went to great lengths to make sure the interaction with the local file system (quota increase) is user initiated.
I don't see why the same techniques couldn't be applied to a SaveFileDialog API.
This is important, developers (such as myself) are designing applications that will consume user files and process them. The user will want these files back eventually. Round-tripping a once local file to the server, just so the user can move it local
again works, but it's cludgey, and I would argue potentially as unsafe, if not more, than providing a mechanism for client-side save (data in transit twice, across the Internet vs. once on a trusted local machine...).
Looking through the forums, I see many other folks are also interested in this feature. ksleung also makes a very good point about SL's main competition in the client-side rich UI space (though I dare not speak it's name).
I have the same need. Looks like I need to do the heavy processing in Silverlight and output using Flash10.
ksleung: Out of interest, how did you pipe the data to Flash 10? Is it directly from the Silverlight control to the Flash control?
Thanks,
Michael
Well, I am still looking into it. Flash development is not my forte so my progress there was slow. So far what I got was a Flash app (.swf) that can load from and save to local disk), and I am still writing the hooks for it to talk to Javascript. On the
other hand, Silverlight to/from Javascript is easy and elegant (well done, SL team!).
Depending on whether I can call Flash function exposed to Javascript directly from Silverlight, it woud either be Silverlight -> Flash or Silverlight -> Javascript -> Flash. In any case, I would also have to encode the bytes into a string and decode at
the other end, since I think Silverlight/Flash/Javascript does not play nice with each other wrt array.
BTW I build the .swf file using Flex SDK (free), not Flex Builder.
There are a few articles that talk about Silverlight/Flash interop (just search "silverlight flash interop", from which I got most of the idea. If I have the code ready I am willing to share but I don't have it yet. One more thing about this convoluted
path... I heard it doesn't work on Mac since they need LocalConnection between Javascript and Flash... whatever that means.
Again, I want to say that this is really a silly path that I don't have to go through. I hope the SL team is thinking hard about this...
Visit http://www.tagxedo.com, a Silverlight-based word cloud generator. If you like it, please help me spread the word!
MS always says that there is some security reansons, the silverlight app is running is sandbox, and so on. But I think even the coder can show a savefiledialog to user, if the user doesn't save it, the file is still cannot be in the local disk file system.
However users maybe don't know what the file is, if the file is a virus, and when it is saved, it breaks... This is a big trouble, so Microsft doesn't like savefiledialog.
If we limit the file type of savefiledialog to just some txt files, it is not ok too. Clearly, we need more. I think there must be a mechanism that can ensure the file that is to be saved to local disk is safe, if we cannot ensure this, MS will not add SaveFileDialog
to Silverlight.
Ling Bing
Bei Jing University of Aeronautics and Astronautics
Bei Jing, China
I have the same need. Looks like I need to do the heavy processing in Silverlight and output using Flash10.
ksleung: Out of interest, how did you pipe the data to Flash 10? Is it directly from the Silverlight control to the Flash control?
Thanks,
Michael
Well, I am still looking into it. Flash development is not my forte so my progress there was slow. So far what I got was a Flash app (.swf) that can load from and save to local disk), and I am still writing the hooks for it to talk to Javascript. On the
other hand, Silverlight to/from Javascript is easy and elegant (well done, SL team!).
Depending on whether I can call Flash function exposed to Javascript directly from Silverlight, it woud either be Silverlight -> Flash or Silverlight -> Javascript -> Flash. In any case, I would also have to encode the bytes into a string and decode at
the other end, since I think Silverlight/Flash/Javascript does not play nice with each other wrt array.
BTW I build the .swf file using Flex SDK (free), not Flex Builder.
There are a few articles that talk about Silverlight/Flash interop (just search "silverlight flash interop", from which I got most of the idea. If I have the code ready I am willing to share but I don't have it yet. One more thing about this convoluted
path... I heard it doesn't work on Mac since they need LocalConnection between Javascript and Flash... whatever that means.
Again, I want to say that this is really a silly path that I don't have to go through. I hope the SL team is thinking hard about this...
Ha, I just found out that Adobe Flash 10 now imposes a stricter security policy in which a Load/Save dialog request MUST be initiated from a button event and cannot be initiated programmatically. This actually breaks a few applications such as Flickr upload,
as I heard. This also means that the route I was thinking of is quite a bit harder, since I somehow need to make it such that a Flash button is physically pressed when I need to load/save.
Maybe they did this to prevent someone like me from doing what they think I want to do. "No Silverlight shortcut for you!" :D
Visit http://www.tagxedo.com, a Silverlight-based word cloud generator. If you like it, please help me spread the word!
I am very much ok with a user-initiated scenario as long as we can get the SaveFileDialog via Silverlight. That's just a simple matter of asking the user for permission, and let them make the choice. But to have no options at all for this, except for a
round trip to a server, seems a bit too restrictive. I'd sure like someone from MSFT to weigh in on this soon...
We can understand SaveFileDialog may bring much convenience to our daily work. However, not all the users have enough knowledges when they visit websites. Many riskes may be brought by mis-typing or something else. Anyway, thanks for the post.
Best regards,
Jonathan
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
Again, this is the "security" argument that I detailed. Fully understood. However, I wish you guys can take a look at what Adobe did with Flash 10, which is to open up this capability after 10 years of obnoxious server round-trip. Currently their product
has a much higher penetration and is exposed to many more people and many more applications. This would not be something that they did at a whim. In fact, I believe their final compromise -- which is to insist that SaveFileDialog be triggered by a user button
click event but never programatically -- makes this feature no worse than existing Flash vulnerability. If you are afraid of allowing the user to generate an action by pressing a button, well, what more can I say.
This is a feature that many web applications can greatly benefit from. After all, why support LoadFileDialog when you can never save? Silverlight is a once in a blue moon great product from Microsoft, and I hope you guys can make it greater, not lamer.
Visit http://www.tagxedo.com, a Silverlight-based word cloud generator. If you like it, please help me spread the word!
We can understand SaveFileDialog may bring much convenience to our daily work. However, not all the users have enough knowledges when they visit websites. Many riskes may be brought by mis-typing or something else. Anyway, thanks for the post.
I gotta say, I don't understand the security argument at all. If it's so dangerous, why allow IE to save a file at all? And even worse, why allow an OpenFileDialog? With a SaveFileDialog, the worst that could happen would be to overwrite an existing file.
So for damage to occur, someone would have to a) see an OpenFileDialog b) select an existing file c) select yes to "Overwrite this existing file". Are you guys really going to cripple Silverlight to protect those so brain dead that they actually fall for a,
b, then c? Here's another way to look at it. If someone is that stupid, there are going to be much easier ways to cause compromise their system than a SaveFileDialog box.
ksleung
Contributor
6680 Points
1265 Posts
SaveFileDialog? Please help make it possible
Oct 22, 2008 07:14 PM | LINK
I'm on the verge of doing something silly and I hope the SL team can save me from doing so, and my peer developers can pitch in... :D
When I first found out Silverlight supports OpenFileDialog, I felt this could be significant since it brings web-app closer to desktop-app (and even a competitive advantage over Flash). But the lack of the complimentary SaveFileDialog really makes it a rather moot point, at least less relevant.
But now Flash 10 is out and they support both OpenFileDialog and SaveFileLog, so it is silly to continue to say why SL shouldn't support it in the name of "security". IMO SL should support it ASAP, hopefully no later than 2.1. This feature, though small, gives Flash tremendous inroad into the desktop space without going through AIR (which seems bloated to me).
In my SL app, I already uses LoadFileDialog but the lack of SaveFileDialog drives me crazy... Now I am thinking about having both SL2 and Flash 10 in my application, and when I need to save something, I pipe the data to Flash 10 and do it there. For consistency reason I may move OpenFileDialog to Flash 10 as well. Only thing that stops me from doing so is that I hate Flash development, but I guess sometimes need trumps over desire.
This is really silly... I wish I don't have to go this route... "Here's a great SL app, oh but to run it you need both SL2 and Flash10!"
prujohn
Contributor
3609 Points
713 Posts
Re: SaveFileDialog? Please help make it possible
Oct 22, 2008 08:04 PM | LINK
Funny, I was just about to write a post about this topic. Glad I scanned the forum first.
I wholeheartedly second this request for SaveFileDialog. When I look at the way the IsolatedStorage is implemented, I see that the SL team went to great lengths to make sure the interaction with the local file system (quota increase) is user initiated. I don't see why the same techniques couldn't be applied to a SaveFileDialog API.
This is important, developers (such as myself) are designing applications that will consume user files and process them. The user will want these files back eventually. Round-tripping a once local file to the server, just so the user can move it local again works, but it's cludgey, and I would argue potentially as unsafe, if not more, than providing a mechanism for client-side save (data in transit twice, across the Internet vs. once on a trusted local machine...).
Looking through the forums, I see many other folks are also interested in this feature. ksleung also makes a very good point about SL's main competition in the client-side rich UI space (though I dare not speak it's name).
John
LUCA Studios
MichaelWalsh
Member
2 Points
2 Posts
Re: SaveFileDialog? Please help make it possible
Oct 24, 2008 12:01 AM | LINK
I have the same need. Looks like I need to do the heavy processing in Silverlight and output using Flash10.
ksleung: Out of interest, how did you pipe the data to Flash 10? Is it directly from the Silverlight control to the Flash control?
Thanks,
Michael
ksleung
Contributor
6680 Points
1265 Posts
Re: SaveFileDialog? Please help make it possible
Oct 24, 2008 04:28 AM | LINK
Well, I am still looking into it. Flash development is not my forte so my progress there was slow. So far what I got was a Flash app (.swf) that can load from and save to local disk), and I am still writing the hooks for it to talk to Javascript. On the other hand, Silverlight to/from Javascript is easy and elegant (well done, SL team!).
Depending on whether I can call Flash function exposed to Javascript directly from Silverlight, it woud either be Silverlight -> Flash or Silverlight -> Javascript -> Flash. In any case, I would also have to encode the bytes into a string and decode at the other end, since I think Silverlight/Flash/Javascript does not play nice with each other wrt array.
BTW I build the .swf file using Flex SDK (free), not Flex Builder.
There are a few articles that talk about Silverlight/Flash interop (just search "silverlight flash interop", from which I got most of the idea. If I have the code ready I am willing to share but I don't have it yet. One more thing about this convoluted path... I heard it doesn't work on Mac since they need LocalConnection between Javascript and Flash... whatever that means.
Again, I want to say that this is really a silly path that I don't have to go through. I hope the SL team is thinking hard about this...
lingbing
Contributor
2249 Points
406 Posts
Re: SaveFileDialog? Please help make it possible
Oct 24, 2008 05:20 AM | LINK
MS always says that there is some security reansons, the silverlight app is running is sandbox, and so on. But I think even the coder can show a savefiledialog to user, if the user doesn't save it, the file is still cannot be in the local disk file system. However users maybe don't know what the file is, if the file is a virus, and when it is saved, it breaks... This is a big trouble, so Microsft doesn't like savefiledialog.
If we limit the file type of savefiledialog to just some txt files, it is not ok too. Clearly, we need more. I think there must be a mechanism that can ensure the file that is to be saved to local disk is safe, if we cannot ensure this, MS will not add SaveFileDialog to Silverlight.
Bei Jing University of Aeronautics and Astronautics
Bei Jing, China
ksleung
Contributor
6680 Points
1265 Posts
Re: SaveFileDialog? Please help make it possible
Oct 24, 2008 05:28 AM | LINK
Ha, I just found out that Adobe Flash 10 now imposes a stricter security policy in which a Load/Save dialog request MUST be initiated from a button event and cannot be initiated programmatically. This actually breaks a few applications such as Flickr upload, as I heard. This also means that the route I was thinking of is quite a bit harder, since I somehow need to make it such that a Flash button is physically pressed when I need to load/save.
Maybe they did this to prevent someone like me from doing what they think I want to do. "No Silverlight shortcut for you!" :D
prujohn
Contributor
3609 Points
713 Posts
Re: SaveFileDialog? Please help make it possible
Oct 24, 2008 06:40 PM | LINK
I am very much ok with a user-initiated scenario as long as we can get the SaveFileDialog via Silverlight. That's just a simple matter of asking the user for permission, and let them make the choice. But to have no options at all for this, except for a round trip to a server, seems a bit too restrictive. I'd sure like someone from MSFT to weigh in on this soon...
John
LUCA Studios
Jonathan She...
All-Star
50156 Points
4951 Posts
Microsoft
Re: SaveFileDialog? Please help make it possible
Oct 28, 2008 09:28 AM | LINK
Hi All,
We can understand SaveFileDialog may bring much convenience to our daily work. However, not all the users have enough knowledges when they visit websites. Many riskes may be brought by mis-typing or something else. Anyway, thanks for the post.
Best regards,
Jonathan
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework
ksleung
Contributor
6680 Points
1265 Posts
Re: Re: SaveFileDialog? Please help make it possible
Oct 28, 2008 05:46 PM | LINK
Again, this is the "security" argument that I detailed. Fully understood. However, I wish you guys can take a look at what Adobe did with Flash 10, which is to open up this capability after 10 years of obnoxious server round-trip. Currently their product has a much higher penetration and is exposed to many more people and many more applications. This would not be something that they did at a whim. In fact, I believe their final compromise -- which is to insist that SaveFileDialog be triggered by a user button click event but never programatically -- makes this feature no worse than existing Flash vulnerability. If you are afraid of allowing the user to generate an action by pressing a button, well, what more can I say.
This is a feature that many web applications can greatly benefit from. After all, why support LoadFileDialog when you can never save? Silverlight is a once in a blue moon great product from Microsoft, and I hope you guys can make it greater, not lamer.
jackbond
Contributor
5812 Points
1559 Posts
Re: SaveFileDialog? Please help make it possible
Oct 29, 2008 02:29 AM | LINK
I gotta say, I don't understand the security argument at all. If it's so dangerous, why allow IE to save a file at all? And even worse, why allow an OpenFileDialog? With a SaveFileDialog, the worst that could happen would be to overwrite an existing file. So for damage to occur, someone would have to a) see an OpenFileDialog b) select an existing file c) select yes to "Overwrite this existing file". Are you guys really going to cripple Silverlight to protect those so brain dead that they actually fall for a, b, then c? Here's another way to look at it. If someone is that stupid, there are going to be much easier ways to cause compromise their system than a SaveFileDialog box.
Khet - The first Silverlight multiplayer game
Zork I: The Great Underground Empire