Solved

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

Posted on 2011-03-04
24
578 Views
Last Modified: 2012-05-11
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
Comment
Question by:Roberth509
  • 11
  • 8
  • 2
  • +2
24 Comments
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 35038243
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
 
LVL 29

Expert Comment

by:Badotz
ID: 35038333
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
 
LVL 13

Expert Comment

by:devlab2012
ID: 35038344
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
 
LVL 13

Expert Comment

by:devlab2012
ID: 35038367
@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
 
LVL 29

Expert Comment

by:Badotz
ID: 35038507
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
 

Author Comment

by:Roberth509
ID: 35038695
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
 

Author Comment

by:Roberth509
ID: 35038727
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
 
LVL 29

Expert Comment

by:Badotz
ID: 35038776
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
 

Author Comment

by:Roberth509
ID: 35038860
IE is fine for now...
0
 

Author Comment

by:Roberth509
ID: 35039304
Badotz,
I'll be happy to receive your IE6 code...
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35039655
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:Roberth509
ID: 35044166
Well , this is basically my question...how should this code be?
0
 
LVL 29

Accepted Solution

by:
Badotz earned 500 total points
ID: 35046429
0
 
LVL 29

Expert Comment

by:Badotz
ID: 35824176
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
 

Author Comment

by:Roberth509
ID: 35824379
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
 
LVL 29

Expert Comment

by:Badotz
ID: 35824462
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
 

Author Comment

by:Roberth509
ID: 35824702
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
 

Author Comment

by:Roberth509
ID: 35824737
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
 

Author Comment

by:Roberth509
ID: 35841802
Moderator,
I am now prepared to award, but can´t. Please enable awarding..
Thanks
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35841809
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
 

Author Comment

by:Roberth509
ID: 35841810
Moderator,
I am now prepared to award, but can´t. Please enable awarding..
Thanks
0
 

Author Closing Comment

by:Roberth509
ID: 35841878
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
 
LVL 29

Expert Comment

by:Badotz
ID: 35841948
No worries - glad to help.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now