Comments (6)
It doesn't support multipart/form-data
, (it will ignore the upload data).
from v8-archive.
Question 2:
Why not?
Q 3:
Can the API support multipart/form-data
?
from v8-archive.
Why not?
No reason at all, we haven't implemented yet.
Can the API support multipart/form-data?
Yes it can support it. Probably the only drawback is that we can't sent user-defined information about this file, such as file title, description.
from v8-archive.
the only drawback is that we can't sent user-defined information about this file, such as file title, description.
If we include fields in the same form with the name
matching the database column, it should be doable right?
from v8-archive.
The file data uploaded will replace the field containing the user-defined (if any) title, description etc.
Example:
Currently we can do this:
{
"title": "new article",
"header_image": {
"title": "new article header image",
"description": "a happy team",
"data": "<base-64-data>"
}
}
We send user-specific information such as title
and description
.
On the other hand when we use multipart the data for header_image
that field information becomes only the file data: rough example below:
POST /_/items/articles HTTP/1.1
Host: directus-api.local
Content-Type: multipart/form-data; boundary=----Boundary
----Boundary
Content-Disposition: form-data; name="title"
new article
----Boundary
Content-Disposition: form-data; name="header_image"; filename="header_image.jpg"
Content-Type: image/jpeg
<ImageContent>
----Boundary--
The header section has the binary content of the header_image.jpg
.
We can research if there's a possible way to send this information through multipart or we can create a workaround.
from v8-archive.
Ahh, yeah we lose the ability to send nested values, that's true. But it would still be useful for asynchronous uploads to /files
directly.
Usecase: uploading files to insert into a WYSIWYG editor
from v8-archive.
Related Issues (20)
- How to Delete all the item with where clause? HOT 1
- How to load images dynamically into angular application via directus sdk?
- How to fetch Request Body in Custom API? HOT 1
- Calling any data API from browser address bar gets data even no token is provided
- Cannot drag on collections with 'sort' field HOT 1
- MySQL JSON data type support
- Publish changes for release 8.8.2 HOT 3
- Last_access_on user field Data is not getting added
- Directus 9, do i set permissions on Files? HOT 1
- Login into directus takes very long (when using a new browser window, It takes 4.37 min)
- JWT Mode not working
- Input is not readonly when user has only read permission
- Export collection HOT 2
- Forbidden on importing existing tables
- Save as Copy errors not shown to the user HOT 1
- Save as Copy option without Create permission HOT 1
- Setting the SDK types correctly so that you can fetch translations as well.
- Non Adminstrator Users able to change their own role to Administrator HOT 1
- Where I can see error logs?
- proxy support for Directus 8.6.2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v8-archive.