Comments (6)
Hi,
Can you print out the status code details for status code 500? There should be error messages returned in the POST response which will get more details on what is failing.
Can you also try python script "DeviceFirmwareSimpleUpdateREDFISH.py" to see if this works? This will help narrow down if its a script issue or iDRAC issue.
Thanks
from idrac-redfish-scripting.
Hi,
POST command returns an empty string along with status code 500 "Internal Server Error", the python script works fine.
Thanks
from idrac-redfish-scripting.
Hi,
I've tried the same procedure but this time using Postman, and I'm still getting the 500 error, here's the output from Postman
here the headers I'm using
from idrac-redfish-scripting.
For the Body, did you select "File" for a key and then choose a file? I repro the issue you were seeing but this happened because i didn't set up the Body to point to a file.
Here's from my server below showing the Body where i pointed it to a file.
from idrac-redfish-scripting.
Hi @texroemer
In fact I'was setting the file the wrong way, when i inserted File key the upload was sucessfull,
Also I was able to fix the error in my code, turns out I didn't escape properly the file and filename strings in the body request, for that reason the server didn't understand the request.
Now the updated code
`private async Task<Uri> UploadFile(string path)
{
using (var request = new HttpRequestMessage(HttpMethod.Post, baseUri + FirmwareInventory))
using (var multipartContent = new MultipartFormDataContent())
using (var fileContent = new StreamContent(File.Open(path, FileMode.Open)))
{
request.Headers.Authorization = credentials;
string etag = await GetHeaderValue("ETag", baseUri + FirmwareInventory);
request.Headers.TryAddWithoutValidation("If-Match", etag);
request.Headers.CacheControl = CacheControlHeaderValue.Parse("no-cache");
fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse("multipart/form-data");
fileContent.Headers.ContentDisposition = new ContentDispositionHeaderValue("form-data")
{
Name = "\"file\"",
FileName = string.Format("\"{0}\"", Path.GetFileName(path))
};
multipartContent.Add(fileContent);
request.Content = multipartContent;
using (HttpResponseMessage response = await client.SendAsync(request))
{
if (!response.IsSuccessStatusCode)
throw new HttpRequestException("Falha no upload do arquivo: " + response.ReasonPhrase);
return response.Headers.Location;
}
}
}`
Thanks for your help.
from idrac-redfish-scripting.
Good to hear you got it to work and also fixed your script, glad to help out!
from idrac-redfish-scripting.
Related Issues (20)
- Importing CA certificate to iDRAC via Redfish HOT 6
- Traceback error running ExportSystemConfigurationLocalREDFISH.py HOT 2
- Delete portion of CreateDeleteIdracUsersREDFISH.py only disables the account; it doesn't delete it. HOT 2
- Redfish Resource not found - Export Configuration HOT 1
- Can't insert CD and RemovableMedia virtual media simultaneously HOT 5
- iDRAC Version 7.00.00.171 Traceback Errors HOT 14
- Export/import certificates HOT 1
- Account Services Question HOT 6
- Set-IdracLcSystemAttributesREDFISH does not work on iDRAC8 HOT 3
- Invoke-ChangeIdracUserPasswordREDFISH - New-Object : Exception calling ".ctor" with .... HOT 5
- GetFirmwareInventoryREDFISH.py - Enhancement request: Add or create new version to save to network share HOT 2
- LLDP is not providing the Device ID and the Port ID information. HOT 2
- Use redfish to mount local iso for OS install similar to how webUI works HOT 2
- iDRAC per FQDN via Redfish HOT 14
- Exported ServerConfigurationProfile has commented out properties HOT 2
- Where is the script GetBiosBootOrderBootSourceStateREDFISH.py? HOT 2
- Attribute HttpDev1Interface Vs PxeDev1Interface HOT 7
- Redfish Query HOT 6
- Unable to programmatically clear the Bios Setup Password on a Dell PowerEdge R750 HOT 5
- Broken link 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 idrac-redfish-scripting.