EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Saving files to UNC Path

Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.
#22830
Posted: 12/16/2012 19:53:01
by Henk Leferink (Standard support level)
Joined: 12/16/2012
Posts: 16

Hi, We are developing an application that will download temp files from Internet save the files in the solfs drive. We can able to successfully download and save it to the drive. We are using solfs process restriction only to my app. From Windows explorer the drive is not accessible, But if we use a browse dialog then I can able to access the files on solfs drive. Is any possible method to hide the solfs drive from the browse dialog?

If not, please tell me how can we download and save files to hidden UNC path?. I can able to read the files.

Regards,
Benjamin
#22832
Posted: 12/17/2012 02:24:02
by Eugene Mayevski (EldoS Corp.)

1. If you need access for only your process, is OS edition needed at all? With Application edition you can use the same SolFS container and access it using only SolFS API (which is very similar to and to large extent compatible with Windows, .NET and VCL APIs), so the contents won't be visible to other applications at all.

2. Where does the open dialog come from? Is it invoked from your application? When it is, it's a part of your application which is allowed access to the storage, so surely the dialog will see the disk.


Sincerely yours
Eugene Mayevski
#22833
Posted: 12/17/2012 02:30:23
by Eugene Mayevski (EldoS Corp.)

Also what exactly problem are you having with UNC paths? They are described in documentation.


Sincerely yours
Eugene Mayevski
#22835
Posted: 12/17/2012 03:47:30
by Henk Leferink (Standard support level)
Joined: 12/16/2012
Posts: 16

Hi, Thanks for your reply. We need Solfs os edition for certain circumstances. Now, I want to know how to save a file I'm downloading from internet directly to the mounted UNC path?

We have our own download manager API. Now we are giving the path to save directly to the mounted virtual drive like B:\temp\data.cache but in UNC we can't give like this.

To avoid the chance to see our cache files which we invoke the browse dialog from our app, we are planning to use UNC. My question is, How can I save the file which we download from internet to this UNC path?

Regards,
Ben
#22836
Posted: 12/17/2012 04:26:54
by Eugene Mayevski (EldoS Corp.)

Quote
Henk Leferink wrote:
We have our own download manager API. Now we are giving the path to save directly to the mounted virtual drive like B:\temp\data.cache but in UNC we can't give like this.


Why not?

\\.\MyDisk\temp\data.cache should work. If it doesn't, then it's a bug of download manager API. I know some .NET classes previously (in .NET 2.0 at least) didn't like such paths, but I don't know current situation.


Sincerely yours
Eugene Mayevski
#22837
Posted: 12/17/2012 06:43:56
by Henk Leferink (Standard support level)
Joined: 12/16/2012
Posts: 16

Hi, it worked. But I have a problem while writing a file,using filestream concept.

"FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\.\" in the path"

Regards,
Benjamin
#22838
Posted: 12/17/2012 06:48:51
by Eugene Mayevski (EldoS Corp.)

Yes, that's it. You need to update your code which uses FileStream, to use some other file writing mechanism (eg. P/Invoke). You can try using P/Invoke to call CreateFile() WinAPI function, then pass the obtained handle to the constructor of FileStream which accepts an opened handle. This should work.


Sincerely yours
Eugene Mayevski
#22845
Posted: 12/17/2012 08:31:51
by Henk Leferink (Standard support level)
Joined: 12/16/2012
Posts: 16

Hi, I solved it for c# app. Now getting the same but for java. Can you give a solution how to solve on java?

java.io.FileNotFoundException: FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\.\" in the path.
#22846
Posted: 12/17/2012 08:37:23
by Eugene Mayevski (EldoS Corp.)

We have limited experience with Java so besides using some JNI I have no suggestions.


Sincerely yours
Eugene Mayevski
#22847
Posted: 12/17/2012 08:44:21
by Alexander Plas (EldoS Corp.)

Hello

You can try to use \\?\ prefix instead of \\.\, but I not sure if it resolve the problem.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 7432 times

Number of guests: 2, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!