Thank you for your post.
First of all, make sure the volume is loaded on the client desktop. Second, use the entire path name. If the logged in volume shows user names, then they will need to be specified. Using your example:
When you open the scpdc volume, it is looking in the steved$ folder, then the Documents folder, and then test.txt
When you open the scpdc volume, it is looking in the users folder, then the steved folder, and then test.txt
Both of the above are entirely different, so you'll need to determine which one is correct.
First off, Sorry, I see I added Documents to one of the lists of file paths.
Also, I must not have been clear about how I'm trying to get the email to send. I'm trying to send the email using filemaker server, as a schedule not on a client computer. It works fine on a client computer, but when I use server it does not attach the file.
Does it still matter if the client computer can load the file, if we are sending the file through the email from the server?
Hopefully that clears things up :)
Thank you for the additional information, but I am still a little confused.
Are you trying to have the server execute a script via a schedule? If so, then any attachments must be located on the server in either the Documents folder or Temp folder. Please see Knowledge Base Article #7035:
Although the Knowledge Base article describes Import/Export, it also applies to Send Mail attachments.
If the client is trying to attach a file that is on a server, then my previous post is correct. That is, make sure the client has the server mounted prior to running the script. Otherwise, the server will not be found, and there will be no attachment.
We must not be explaining it properly yet.
Article #7035 we looked at, but did not find it to help our situation.
To help find our problem, we are now trying to export a file using the server on a running scheduled script.
When we use the path
to export a file using the script step: EXPORT RECORDS, no file is created. The thought is that this would create a file test4.12.csv either in the documents folder as mentioned in article 7035, or in the temp. folder. The server is set up in such a way that there is no 1 my documents folder though. The mydocuments are maped to a drive on the server for each person at the company. That causes many different mydocuments folders to exist, but no specific mydocuments folder exists for the filemaker admin account.
We received three different error codes: 4, 102, 800. Our thought is error code 800 would be most relevant.
Thanks for your help
Server side scripts are extremely limited. Quoting from the knowledgebase article 7035:
FileMaker Server can only import from and Export to the following locations:
- When using the Import Records script step or Export Records script step in a FileMaker Server scheduled script, keep the following in mind:
- Any specified file must be in the Documents folder, the temporary folder, or a child folder of either the Documents folder or the temporary folder.
For example, the following are all valid paths for file.csv:
Note that ":test4.12.csv" doesn't fit any of the above options.
I thank you for the advice PhilModJunk.
My Question then switches to how do I find the correct Documents folder, or temporary folder?
Also, am I correct that one of these should work?
P.S. Sorry for my complete ignorance.
I haven't tried this on a server scheduled script, but you have get functions that return the location of those folders.
Get ( DocumentsPath ) is one example. WHen you a script that uses this function, it returns the location of your documents folder. Run from a server scheduled script, it should return the server's documents folder.
Quoting from the help file:
When running on FileMaker Server, Get(DocumentsPath) returns the location of the Documents folder, which is in the same folder as the server's Backups, Databases, and Scripts folders. The Documents folder is used as a shared location that scripts from different sessions or other processes on the machine can use to import or export files.
IT ATTACHES!!! :smileyhappy: , except the attachment does not correctly attach. It now causes the error: "There was an error opening this document. The file is damaged and could not be repaired. "
It can find the file now though.
I am now wondering how to get the email to attach correctly. It attaches correctly if I do not use the server, but once the server runs it stops attaching correctly.
Same Problem here
I create a variable $path= "filewin:" & Get ( DocumentsPath ) & "name.xls"
I use the export to create the file then I try to send it by e-mail SMTP
When the script run locally, every thing is fine, on the FMS10 with Win2003, it's not working
I also trap the last error after sending the e-mail with the attachment to see if it's generating an error... NOPE !! the e-mail in some case is not even sent and still no error is generated ?!?!
In my scrip I repeate 2 time a send e-mail with the same attachment, the 1st one is not sent at all, the second one is sent, but the file is not attach.
Why make it simple when you can make it the Filemaker way ??!!