Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 625
  • Last Modified:

Create folder on client side and then copy files there from server

I have an ASP application and I would please like code from scratch that would:

1) create folder "Client Folder" on root c:\ of client machine (if it does not exist); then

2) would copy all  *.xls from folder "C:\Server Folder" on the server (server name is serverweb) to this "Cliente Folder" above.


I wonder how this solution will pass the permissions issue on the cliente side. Please suggest best workaround...



Thank you
0
Roberth509
Asked:
Roberth509
  • 11
  • 8
  • 2
  • +2
1 Solution
 
rawinnlnx9Commented:
This is not possible. For security reasons you will never access the C:\ root of a guests computer that visits your site. Not by any known way in .Net ASP, etc... If you want to punch holes into their machine using known exploits (illegal) you can get this done but nobody here is going to help you with that.

There is only 1 way to do what you want.

1. Ask the user if they wish to download your file.
2. Give them a browse for folder/file download and let them choose where to save.
3. Let them save the files.

Now if you are doing this on your local domain, well even on the web. You could write something akin to ActiveX or a downloadable executable they could run, it would get their user permissions and then it could download these files. But that's about the only way to legally do this and you will get crucified if you do this without telling your users what you are doing.
0
 
BadotzCommented:
Oh, it is possible.

By relaxing your browser security, you could use the FileSystemObject to manipulate files, folders, etc. BUT this is only likely on an inTRAnet, where you can control the browser AND the users.

I have done this with IE and a web app I authored for in-house use at an HVAC company.
0
 
devlab2012Commented:
It is not possible. You have to develop an ActiveX control for that. Developing ActiveX controls for Internet Explorer is completely different area of programming as compared to ASP.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
devlab2012Commented:
@Badots, you are using FileSystemObject to create folders/files on the machine where ASP file is executing i.e. on the SERVER. In you server you have server and client on the same local network or possibly same machine. Otherwise FileSystemObject runs only on the server and it cannot access the file system of client machine.
0
 
BadotzCommented:
devlab2012: Please do not tell me what I have done.

I was creating files and folders on the CLIENT. It was a necessary part of the app.
0
 
Roberth509Author Commented:
Just had a thought: if it is impossible to bypass the permissions issue, please imagine this will be done manually on the cliente folder before the code is executed
0
 
Roberth509Author Commented:
Sorry...just read all responses now. Well, yes...this application is running on an intranet....Suposing the machine adnministrator gave the permisssion then....whichi could be the best solution?
0
 
BadotzCommented:
I'd use the Scripting.FileSystemObject.

What browser do you target? I have only tried IE, and that was a while ago (IE5/6).
0
 
Roberth509Author Commented:
IE is fine for now...
0
 
Roberth509Author Commented:
Badotz,
I'll be happy to receive your IE6 code...
0
 
BadotzCommented:
Not sure I even have a copy of the app anymore, but I'll look around.

It wasn't magic, I just instantiated the FSO in a var and went wild. Using JavaScript on the client.

Give it a shot:

var fs = new ActiveXObject("Scripting.FileSystemObject");

or something like that...
0
 
Roberth509Author Commented:
Well , this is basically my question...how should this code be?
0
 
BadotzCommented:
The correcting of devlab2012 after he said "it can't be done" (and then proceeding to tell me what he thought I had done) is worthy of merit.

I told Roberth509 what I used to do the job and I posted links to using the FileSystemObject and examples of creating textfiles.

While I did not post specific code, I pointed Roberth509 in the Right Direction, looking forward to more interaction.

That Roberth509 did not repond after that does not diminish my efforts.

But points are not awarded for effort, I know, so if I don't deserve them, no one does.
0
 
Roberth509Author Commented:
Badotz,
Your interpretation is correct of the facts and yes, I am gratefull for your effort and would like to continue counting with you.
I am not thatr experienced on how to rate and award if trhe solution did not in fact show up.
What happened was that the sollution was not provided - and therefor I diod not award,,,but yes, after a while an a bit of struggle I managed the sollution myself. I do recgnize you showed me the way....please tell me what is expected on these circunstances, and I´ll do it because it is fair. There isn´t a 'partially solved option for one to rate...
0
 
BadotzCommented:
If you found a solution, it is always good to post it. That gives the question value from which someone in the future may benefit.

If you were struggling, then why not ask for more help? It's what we do ;-)

If I helped you solve this, then award points as you see fit. If you did it on your own, then post your code and select it as the solution.

Finally, if you need more help, click the Request Attention link in the original question.
0
 
Roberth509Author Commented:
Fair enough...the solution I used involved changing by far the original request and therefor I will close the question with where I got the guide lines.
Thanks
0
 
Roberth509Author Commented:
Moderator,
Please read above to understand the reason why I would like to cancel the request to delete this question. Meanwhile I can´t rate..


0
 
Roberth509Author Commented:
Moderator,
I am now prepared to award, but can´t. Please enable awarding..
Thanks
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I've requested that this question be deleted for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
Roberth509Author Commented:
Moderator,
I am now prepared to award, but can´t. Please enable awarding..
Thanks
0
 
Roberth509Author Commented:
Badotz was very helpful, but I don't think he recognized how weak I was...I was expecting a ready-to-go solution.
I ended up changing my solution and did make use of the help he provided.
0
 
BadotzCommented:
No worries - glad to help.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 11
  • 8
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now