TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ahmed elbarbary
NA
1.6k
278k
File created with name [object formdata] but it must be name delivery.
Dec 7 2020 7:55 PM
I work on asp.net core 2.2 Project with angular 7 . I face issue when download file
It created with Name [object FormData].xlsx but Name must be DeliveryGeneration_Output.xlsx .
on Angular 7
public
uploadFile = (files) => {
const
formData =
new
FormData();
formData.append(
'file'
,
this
.fileToUpload,
this
.fileToUpload.name);
this
.http.post(
'https://localhost:44396/api/ApprovalQuality/'
, formData,{ responseType:
'blob'
})
.subscribe((response: Blob) => saveAs(response, formData +
'.xlsx'
));
}
on Web API .Net Core 2.2
var memory2 =
new
MemoryStream();
using
(var stream =
new
FileStream(exportPath, FileMode.Open))
{
stream.CopyTo(memory2);
}
memory2.Position = 0;
return
File(memory2,
"text/plain"
, Path.GetFileName(exportPath));
Path returned and Created
\\192.168.2.7\\ImportExport\\2\\Export\DeliveryGeneration_Output.xlsx
so why file name created with [object FormData].xlsx and not created with DeliveryGeneration_Output.xlsx
and How to solve this Issue ?
Reply
Answers (
1
)
display list of images in layout using typescript and HTML
pass server side errors to client side typescript using vs code