Saving file to Shared Drive Issue
jflynn
Member Posts: 34
I have the code below that currently saves a file to the
C:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server\WLC\"USERID" folder on the computer of the middle tier. This code works. I would like to save the file to a shared drive on another computer. The middle tier service account has rights to the share drive both in folder permissions and share permissions. I have experimented with the DOWNLOAD function, but need to do this without the user getting involved.
The exact error I get in the RTC is
"Either the caller does not have the required permission or the specified path is read-only."
Here is the code
// folder on share drive
WorkingDir := '\\neptune\shared\ProdRep\FTP';
IF NOT Item.GET(ItemNo) THEN
EXIT;
Delim := '|';
FileName := (WorkingDir+'\10000001.888');
ExportFile.CREATE(FileName);
ExportFile.TEXTMODE(TRUE);
WITH Item DO
ExportFile.WRITE(
'PMF' + Delim +
"No." + Delim +
Description + "Description 2");
ExportFile.CLOSE;
Thanks in advance for your help.
Joe
(Solved using detlaf's solution below. Thanks to all)
C:\Documents and Settings\All Users\Application Data\Microsoft\Microsoft Dynamics NAV\60\Server\WLC\"USERID" folder on the computer of the middle tier. This code works. I would like to save the file to a shared drive on another computer. The middle tier service account has rights to the share drive both in folder permissions and share permissions. I have experimented with the DOWNLOAD function, but need to do this without the user getting involved.
The exact error I get in the RTC is
"Either the caller does not have the required permission or the specified path is read-only."
Here is the code
// folder on share drive
WorkingDir := '\\neptune\shared\ProdRep\FTP';
IF NOT Item.GET(ItemNo) THEN
EXIT;
Delim := '|';
FileName := (WorkingDir+'\10000001.888');
ExportFile.CREATE(FileName);
ExportFile.TEXTMODE(TRUE);
WITH Item DO
ExportFile.WRITE(
'PMF' + Delim +
"No." + Delim +
Description + "Description 2");
ExportFile.CLOSE;
Thanks in advance for your help.
Joe
(Solved using detlaf's solution below. Thanks to all)
Joe
0
Answers
-
I had this problem also. It seems the service tier can only write to a local drive, but you can get around this by saving your file to a temporary directory, then using the DOWNLOAD function to copy the temporary file to a location/filename of your choosing. Then you can delete the temp file as a cleanup operation.
DOWNLOAD(FromFile, DialogTitle, ToFolder, ToFilter, ToFile)
Check out the helpfile for more info. It works like a champ for me. Otherwise you might want to write a server side script to move the files over to your network drive on a timed basis. I couldn't get an RTC instance to write directly to a network drive.0 -
This is another delegation issue.
- In Active Directory Users and Computers open the properties of the user running the NAV Server Service.
- Select the delegation Tab
- Click on Add
- Click Users and Computers...
- Type in the server name that has the share
- Select cfis (if its not there, you need to add the SPN) - HOST may work as well0 -
I had the same issue this week:
I solved it by adding the following two SPNs to the Service User of the Service Tier:
HTTP/ServiceTierServername
HTTP/ServiceTierServername.FQDN
And in in setting the delegation to "Trust this user for delegation to any service (Kerberos only)"
Maybe it is possible to restrict the delegation to the HTTP service, but as I need the Enterprise Admins to evaluate this, I just use "any service" :-)
But I need to try detlefs solution as well...0 -
Hi!
I had the same problem, but the user running rtc services in local system account. How I could apply delegation to this user? In Active Directory can´t find Local System account because it´s protected.
Thx!0 -
anafornies wrote:Hi!
I had the same problem, but the user running rtc services in local system account. How I could apply delegation to this user? In Active Directory can´t find Local System account because it´s protected.
Thx!
Use Network Service account instead of Local System. Then add Delegation for the Server running the NAV Service in Active Directory.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 327 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions