• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 653
  • Last Modified:

Check if network folder exists

Hi,

I have seen some similar questions but most are related to sharepoint which I am not using.

I have an iframe which has its source url set to a folder on my network. In this folder users can create subfolders related to cases using the case number.

I would like the iframe to point to the subfolder if it exists or if it doesnt exsist it should point to the main folder.

I have tried the following code on a webpage and although it is not ideal it is in the right direction (although there are issues with downloading activex objects)

var fso = new ActiveXObject("Scripting.FileSystemObject");
folderBool = fso.FolderExists("d:\\searchfolder");

but this will not work on the the onload of the CRM form (error message: "Automation Server cannot create object")

Any suggestions?

Thanks

Peter
0
abaines
Asked:
abaines
  • 5
  • 5
1 Solution
 
Gurvinder Pal SinghCommented:
Please check if this link is any help to you
http://stackoverflow.com/questions/1361807/what-is-the-best-way-to-check-if-a-website-folder-exists

You cannot do the file handling using javascript.

How ever you can load a file using httpRequest,
var ro;
    if (window.ActiveXObject){
        // code for IE6, IE5
        ro=new ActiveXObject("Microsoft.XMLHTTP");
    }
    else{
        // code for IE7+, Firefox, Chrome, Opera, Safari
        ro=new XMLHttpRequest();
    }
ro.open('get', 'D:/img.log');

just check if ro is null or not.

let me know if this helped

Thanks
0
 
abainesAuthor Commented:
Thanks qurvinder, I am just testing that now. Any idea why I might be getting a permission denied error when I try to run that code from the forms onload event?

I have set the permissions on the txt file so that everybody has full permissions
0
 
Gurvinder Pal SinghCommented:
can you post the code that you have written?

Thanks
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
abainesAuthor Commented:
At the moment I am just trying to get the code exactly as you posted above working, I havent added the if statements yet
0
 
Gurvinder Pal SinghCommented:
ok. What is the url you are giving?

I guess as a security feature, you cannot call pages on 3rd-party domains.

0
 
abainesAuthor Commented:
I have just been testing on the code using C:/test.txt  

The CRM installation is not web facing and it is on the same domain as the file server
0
 
Gurvinder Pal SinghCommented:
what permissions have you given on that file? Could you try giving all permissions to everyone, so that we can isolate the issue?

The same code is working for me on my machine.

Thanks
0
 
abainesAuthor Commented:
Hi,

everyone, users, myself and System have full rights to this file.

Please see images for errors + permissions.

Thanks

Peter
error.jpg
permissions.jpg
0
 
Gurvinder Pal SinghCommented:
0
 
abainesAuthor Commented:
I havent found a solution to this problem so as a temporary measure I have left the users to tick a radio button when they have created a folder so the next time the case is opened it is directed to the sub folder.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now