Folder item confusion.

On the web server I have a temp folder in the applications home.

I’m trying to create a file in that folder using:

GetFolderItem(“temp/” + Today.SQLDate + “-CEU-” + Session.gsName + “.pdf”)

The file doesn’t get created. However when I use:

mFiPDF = SpecialFolder.Temporary.Child(Today.SQLDate + “-CEU-” + Session.gsName + “.pdf”)

it does get created.

mFiPDF is a folder item property on the form.

Any ideas.

Thanks

if DebugBuild then
  mFiPDF  = GetFolderItem("").Parent.Child("temp").Child(Today.SQLDate + "-CEU-" + Session.gsName + ".pdf")
else
  mFiPDF  = GetFolderItem("").Child("temp").Child(Today.SQLDate + "-CEU-" + Session.gsName + ".pdf")
end if

That works on my Mac, but not in the Linux web server.

You can also try this:

if DebugBuild then
  mFiPDF  = App.ExecutableFile.Parent.Parent.Child("temp").Child(Today.SQLDate + "-CEU-" + Session.gsName + ".pdf")
else
  mFiPDF  =  App.ExecutableFile.Parent.Child("temp").Child(Today.SQLDate + "-CEU-" + Session.gsName + ".pdf")
end if

You should avoid using path like that

GetFolderItem("temp/" + Today.SQLDate + "-CEU-" + Session.gsName + ".pdf")

As it stands, temp is next to the program executable. Is it really where the temp folder is ?

You should stick to the documented method :

mFiPDF = SpecialFolder.Temporary.Child(Today.SQLDate + "-CEU-" + Session.gsName + ".pdf")

This has nothing to do with If Debug.

The SpecialFolder.Temporary.Child works on man, not on server.

You should consider using the documented temp folder under Linux /tmp/ instead of placing your temp folder in the applications directory.

That way it should work equally on any platform.

http://documentation.xojo.com/index.php/SpecialFolder

This is what I first had and it didn’t work.

mFiPDF = SpecialFolder.Temporary.Child(Today.SQLDate + “-CEU-” + Session.gsName + “.pdf”)

What path do you get if you skip the Child part and do that separately?

mFiPDF = SpecialFolder.Temporary break mFiPDF = mFiPDF.Child(Today.SQLDate + "-CEU-" + Session.gsName + ".pdf") break

What do you get as a NativePath for each of those two breakpoints?

On the Mac:
Macintosh HD:private:var:folders:yp:lms224vx2kqfz4h9v6xmzgbw0000gn:T:TemporaryItems:
and
Macintosh HD:private:var:folders:yp:lms224vx2kqfz4h9v6xmzgbw0000gn:T:TemporaryItems:2018-03-30-CEU-Richard S. Albrecht CPDT.pdf

Can’t seem to get any debug output on the web server. I tried your suggestion System.log but got nothing.

Well to figure out why temporary isn’t letting you write, we’d need to know what’s going on with the server.

Have you considered Xojo Cloud where all of the maintenance is managed for you?

Problem is our membership data base is hosted there and all the apps, including out desktop apps access it through vpn.

Cloud is also a little expensive for us.

@Richard Albrecht , what are the permissions on the temp folder?