Comments (8)
I need more information regarding how you do file upload. POSTing Binaries to Spark has been tested and should work.
from spark.
Hi,
Thank you for your prompt response.I am using the latest of Spark version 1.5.14 and .Net core version 6.0
I have a simple controller to upload files using the [FromForm] attribute as shown below.
[HttpPost, DisableRequestSizeLimit]
public async Task<ApiResponse> UploadFile
( [FromForm] IFormFile formFile )
{
// Removed my code
return null;
}
Postman CURL script to use this method is.
curl --location --request POST 'https://localhost:44364/api/Document'
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI1NzYzZWQyYjQ0MGI0OTk4OWJlNGY1NjQyNGVkYzFlYiIsImh0dHA6Ly9zY2hlbWFzLnhtbHNvYXAub3JnL3dzLzIwMDUvMDUvaWRlbnRpdHkvY2xhaW1zL25hbWUiOiJqYW1pbGFrMjJAeWFob28uY29tIiwiZXhwIjoxODIyNzE3NzA5LCJpc3MiOiJYZWxsZSIsImF1ZCI6IlhlbGxlIn0.acSOpS1LHJSzgFxJXoQBnYAMicLSsNzWJZQBLeKR4s4'
--header 'Content-Type: multipart/form-data'
--form 'File=@"/F:/DCIM/105APPLE/IMG_5008.JPG"'
--form 'CreatedBy="9b12d575-a29a-436d-8677-c88997327a4f"'
--form 'DocumentType="Workbook"'
but when I submit the form I am getting an unsupported media type error.
I hope you got my issue, please help me out.
Thanks
from spark.
The code you are sharing do not have any relevance to FHIR APIs so I suspect there is some lack of understanding on how to interact with FHIR APIs
You can try the following curl
command against my official test server. Create a text file called test.txt
with some random content and run the following command:
curl --request POST --data-binary "@test.txt" https://spark.incendi.no/fhir/Binary
I recommend that you take a look at the examples I've put up, like this one: https://github.com/incendilabs/spark-example
from spark.
Hi,
Thank you again for the prompt response. Well I know there is a Binary resource where we can store all sorts of documents in binary format which is perfectly fine and it is working at my end as well, I don't have issues with it.
My client wanted to store all their documents in Mongo GridFS, For that purpose I created a separate controller to store and retrieve Documents in GridFS.
For more information I can share my complete project so you would have a clear understanding of my problem and it would help you help me out to resolve this issue.
Here is the complete project, please fill the MongoDB connection string inside appsettings.json.
https://github.com/lumisoftllc/MongoFhir
Below is the curl script to upload files in GridFS.
curl --location --request POST 'https://localhost:44364/api/Document'
--form 'File=@"/F:/DCIM/105APPLE/IMG_5008.JPG"'
--form 'CreatedBy="9b12d575-a29a-436d-8677-c88997327a4f"'
--form 'DocumentType="Workbook"'
Thanks
from spark.
Hi,
Please guys I am wailing for the response.
from spark.
We are overriding the formatters in the MVC pipeline which then interferes with your API at api/Document
. The easiest way to get this to work is to move your DocumentController into a separate project. Then you will have one endpoint (project 1) which is pure FHIR APIs and another endpoint (project 2) where you can add your own APIs like the DocumentController API.
from spark.
Hi!
Thank you so much for the prompt response.
Well my task is to use the same end point for both Fhir and other custom controllers.
Anyhow I have achieved this behavior by sending the files in base64 and then converting into stream and store in GridFS.
Despite that, I appreciate your team for working on this amazing project.
from spark.
Thanks for saying that @LumiProj, that's appreciated
from spark.
Related Issues (20)
- Creating new resources with multiple contained resources which lack id returns 500 Internal Server Error
- Transaction bundles with conditional create do not apply if-none-exist filters
- DocumentReference searches return 0 results when using FHIR R4 'patient' parameter
- DocumentManifest searches return 0 results when using FHIR R4 'patient' parameter
- Provenance searches return 0 results when using FHIR R4 'patient' parameter HOT 2
- Searching HOT 1
- Snapshot is not working HOT 2
- How to implement extensions HOT 3
- Query the token type through the not modifier. HOT 1
- Invalid implementation of GT,GTE,LT,LTE search parameters HOT 2
- Regarding the storage of query parameter Code<T>. HOT 2
- Prefix codes eq, ne, gt, lt, ge, le are not working in chained search.
- Searching Patient by Identifier using only System returns InternalServerError HOT 1
- Bundle response links are broken if ILocalhost.DefaultBase ends with / HOT 1
- Present decimal values as integer for Json output HOT 2
- Performance degradation in FHIR server for high patient registration volume HOT 1
- Bad Request error on PATCH operation for replace operation
- MongoIdGenerator is unsafe when mixed with upsert
- https://spark.incendi.no/ is down HOT 1
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 spark.