initial
This commit is contained in:
commit
74ae93a96e
1 changed files with 94691 additions and 0 deletions
36
joplin notion extension/Web Development/API/fileditch.md
Normal file
36
joplin notion extension/Web Development/API/fileditch.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
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);
|
||||
});
|
||||
})
|
||||
```
|
||||
Loading…
Reference in a new issue