Jump to content

Permission Denied error when using Scribe ScribeDocSaveFile function


This topic is 3993 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi All,

 

This should be a simple one ...

 

I'm using 360Works Scribe to populate data into an Excel spreadsheet template. The solution is hosted in FM Pro Server using Instant Web Publishing.  After the user has examined some dynamic data on the screen, they may download an Excel spreadsheet containing the data.

 

To do this, I open an Excel file that serves as my template using ScriebeDocLoad.  I then populate various fields into the spreadsheet using lots of ScribeDocWriteValue commands based on what the user is viewing, then save the file using the ScribeDocSaveFile function.  I use SuperContainer to house the file and the FileMaker Open URL function to allow the user to download the Excel file.

 

My problem is that the script works the first time download file is created, but fails every following attempt with an error in the ScribeDocSaveFile function.  The error is "java.io.FileNotFoundExceptions:  (my URL)/filename.xlsx (Permission Denied)".  My suspicion is that permissions on the file do not allow the ScribeDocWriteValue function to overwrite a file that already exists.  Yet the file was originally created by Scribe.

 

If I delete the file that was created and run the script again, it works fine.  Only when there is a file in place does it fail.  Does the ScribeDocSaveFile function not allow an overwrite?  If not, I don't see a file deletion function.  I could use AppleScript to delete the file if IWP would support it.  I may have to use 360Works RemoteScripter -- but I'm hoping this is something simple I can fix.

 

Thanks.

Link to comment
Share on other sites

I'll go ahead and answer my own question.  After exploring further, it appears that one actually CAN'T overwrite a file that already exists using the ScribeDocSaveFile function.

 

So I've solved the problem a different way.  Each export gets a unique name (a concatenation of the user's ID and a serial number).  The server hard drive will fill up with downloaded files after a while, but I'll just delete the old downloads and keep the more recent ones.

 

This approach also lets me (using SuperContainer) list all the recent downloads a user has created, just in case they want to re-download something.

Link to comment
Share on other sites

This topic is 3993 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.