Location of temporary file storage on Galaxy

What is the path I need to put in my code to save a temporary file? Acording to the Docs, it is /tmp (http://galaxy-guide.meteor.com/file-storage.html). But I have tried everything I know and it fails when I try to access the file:

Throw er; // Unhandled ‘error’ event
Error: spawn ENOENT
at errnoException (child_process.js:1011:11)
at Process.ChildProcess._handle.onexit

var path = './tmp/';
var filePathPdf= path + 'myTestFile.pdf';
    var pdf = webshot(html, filePathPdf, options, function (err) {
        fs.readFile(filePathPdf, function (err, data) {
            if (err) {
                return console.log(err);

    var Fiber = Npm.require('fibers');

    function sleep(ms) {
        var fiber = Fiber.current;
        setTimeout(function() {
        }, ms);
 // wait for pdf before sending email (cap loop at 5 seconds for testing)
    Fiber(function() {
        var w = 0;
        do {
//this is where it fails----------------------
            test = fs.existsSync(filePathPdf);
        while ((test != true) || (w > 5));

it is clear that “var path = ‘./tmp/’;” is wrong… but I don’t know what it should be…
The code works great on my development server.

Help please and thanks.

You were using relative path ‘./tmp’.
From my understanding, it should be replaced with absolute path ‘/tmp’ as stated on the Docs.