# Pydio API . Upload data

**URL:** <https://forum.pydio.com/t/pydio-api-upload-data/1115>\
**Category:** Development\
**Created:** [May 17, 2018, 12:31pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115 "2018-05-17T12:31:05Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrandria](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jrandria](https://forum.pydio.com/u/jrandria)\
**Post date:** [May 17, 2018, 12:31pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115/1 "2018-05-17T12:31:05Z")

</div>

Omg always this problem when i try to upload with Pydio Api (with nodejs):

Reponse:  
‘\<?xml version="1.0" encoding="UTF-8"?\>Warning, missing either ‘path’ parameter or X-File-Name header.’

Please help

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [May 17, 2018, 12:33pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115/2 "2018-05-17T12:33:45Z")

</div>

Hi,  
could you show me what you used to upload, so that i can locate the error ?

---

<div class="post-metadata">

**Author:** ![jrandria](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jrandria](https://forum.pydio.com/u/jrandria)\
**Post date:** [May 17, 2018, 12:44pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115/3 "2018-05-17T12:44:06Z")

</div>

var URI\_PYDIO = ‘https://…/pydio/api/my-workspace/’;

function uploadToPydio(csvFile) {

```
var fileToUpload = __dirname + '/backup/' + csvFile;
var url = URI_PYDIO + 'upload/?' + jsonFormat;

var readStream = fs.createReadStream(fileToUpload);

var formData = {
    toUpload: {
        value: fs.createReadStream(fileToUpload),
        options: {
            filename: fileToUpload.originalname,
            contentType: fileToUpload.mimeType
        }
    }
};

var options = {
    url: url,
    method: 'POST',
    formData: formData,
    headers: {
        'Content-Type': 'application/json',
        'Content-Length': Buffer.byteLength(body),
        'X-File-Name' : fileToUpload.originalname,
        'Authorization': 'Basic ' + new Buffer('myUSERNAME' + ':' + 'myPASSWORD').toString('base64')
    }
}

request(options, (err, resp, body) => {
    console.log('-------------Upload Finished----------------');
    console.log('Response from server', resp);
    console.log('Erreur from server', err);
    if (err) {
        console.log('Erreur ', err);
    }

    if (!err && resp.statusCode === 200) {
        console.log('Corectly Uploaded');
    }
})

```

}

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [May 17, 2018, 12:49pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115/4 "2018-05-17T12:49:28Z")

</div>

Hi,  
could you put your server in debug mode by following those steps

DEBUG MODE PYDIO

Go to conf/bootstrap\_context.php .  
Switch this line to true :  
define(“AJXP\_SERVER\_DEBUG” , true);

---

<div class="post-metadata">

**Author:** ![jrandria](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jrandria](https://forum.pydio.com/u/jrandria)\
**Post date:** [May 17, 2018, 12:53pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115/5 "2018-05-17T12:53:51Z")

</div>

Thank you , but Unfortunately, I can not access the server because I just integrate an API for a client.  
They want i upload to pydio every Monday a csv file

---

<div class="post-metadata">

**Author:** ![jrandria](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jrandria](https://forum.pydio.com/u/jrandria)\
**Post date:** [May 17, 2018, 1:06pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115/6 "2018-05-17T13:06:05Z")

</div>

What does the error mean ?

Please help

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [May 17, 2018, 1:10pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115/7 "2018-05-17T13:10:13Z")

</div>

> [@jrandria](#):
>
> ‘\<?xml version=“1.0” encoding=“UTF-8”?\>Warning, missing either ‘path’ parameter or X-File-Name header.’

I can’t say more than what the message is saying itself, either the path is missing or wrong or the header.

---

<div class="post-metadata">

**Author:** ![jrandria](https://avatars.discourse-cdn.com/v4/letter/j/c2a13f/32.png) [@jrandria](https://forum.pydio.com/u/jrandria)\
**Post date:** [May 17, 2018, 1:15pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115/8 "2018-05-17T13:15:42Z")

</div>

Thanks .  
According to the documentation how to upload a file :

```
URI_PYDIO/upload or URI_PYDIO/io 

```

Sorry but i don’t understand the pydio documentation .The are no details about how to use exactly upload with the v1 or v2 API.

---

<div class="post-metadata">

**Author:** ![zayn](https://avatars.discourse-cdn.com/v4/letter/z/a87d85/32.png) [@zayn](https://forum.pydio.com/u/zayn)\
**Post date:** [May 17, 2018, 1:23pm UTC](https://forum.pydio.com/t/pydio-api-upload-data/1115/9 "2018-05-17T13:23:21Z")

</div>

Sorry but there is currently a bug on our website we are working on it,  
when it will work again, you go to this part of our site [here](https://pydio.com/en/pydio-api-v2) you will find a guide on how to use the API’s, it will be on the api endpoints section.
