819 B
819 B
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)
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);
});
})