joplin-notes/joplin notion extension/Web Development/API/fileditch.md
2026-11-04 00:33:23 +05:30

36 lines
No EOL
819 B
Markdown

fileditch
https://fileditch.com
- To upload
To upload using curl or make a tool you can post using:
`curl -i -F files[]=@yourfile.jpeg https://up1.fileditch.com/upload.php` (JSON Response)
Javascript(Browser)
```js
const fileInput = document.getElementById('fileInput');
fileInput.addEventListener('change', async (event) => {
const file = fileInput.files[0];
const formData = new FormData();
formData.append('files[]', file);
fetch('https://up1.fileditch.com/upload.php', {
method: 'POST',
body: formData,
})
.then((response) => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.text();
})
.then((data) => {
console.log('Upload successful:', data);
})
.catch((error) => {
console.error('Error during upload:', error);
});
})
```