(#69) Upload multiple images in asp net core | One to Many relationship in ef core | Image gallery

  Рет қаралды 21,676

WebGentle

WebGentle

Күн бұрын

Пікірлер: 29
@georgesiafa4196
@georgesiafa4196 4 жыл бұрын
Thank you so much! I have been trying to do this for ages without any success, now it works thank you!
@kaushikbhadani
@kaushikbhadani 3 жыл бұрын
Thank you, Nitesh! Very nice explanation.
@sabinaghidossi6690
@sabinaghidossi6690 Жыл бұрын
Great tutorial! There is just something that I don't fully understand though, why you do the methods twice? One in the controller and one in the repository? Maybe I didn't understood the function of the repository. Can you kindly explain it to me? Thank you.
@deepro__
@deepro__ Жыл бұрын
Thank you very much, sir.
@chzakirislam1700
@chzakirislam1700 4 жыл бұрын
Awesome tutorial..... I am following your tutorial.... Plz keep uploading videos
@wongguanyan2141
@wongguanyan2141 4 жыл бұрын
Hi! I'm getting error on this Name = file.Filename, URL = await UploadImage(folder, file) It shows error code CS1061 and CS1503 on the (Filename) and (file) ! may I know how to fix this?
@RahulGupta-jk9lb
@RahulGupta-jk9lb 3 жыл бұрын
Check the folder name spelling
@kamilxxx6876
@kamilxxx6876 Жыл бұрын
Is it neccesary to create that list in book? Can you just add images to table without it?
@Mamik227
@Mamik227 Жыл бұрын
thank you!
@avijitroy5104
@avijitroy5104 3 жыл бұрын
Sir, Thank you so much for your great tutorial. I am new in MVC. I have a Question. After choosing the image file, I want to show the image path in file upload control.
@mohamedkunle528
@mohamedkunle528 3 жыл бұрын
if you want to see the chosen photo name you can use this jquery : @section Scripts { $(document).ready(function () { $('.custom-file-input').on("change", function () { var fileName = $(this).val().split("\\").pop(); $(this).next('.custom-file-label').html(fileName); }); }); }
@mazidulislamzahid6057
@mazidulislamzahid6057 3 жыл бұрын
File is being copied but only last row inserted into database. Please provide solution. #region File Upload if (files != null) { Attachment oAttachment = new Attachment(); string CaseNo = oCaseInfo.ID; string newCaseFilePath = Directory.GetCurrentDirectory() + "\\wwwroot" + "\\uploads\\" + CaseNo; if (!Directory.Exists(newCaseFilePath)) Directory.CreateDirectory(newCaseFilePath); //directory create foreach (var file in files) { if (file.Length > 0) { //Getting FileName var fileName = Path.GetFileName(file.FileName); //Assigning Unique Filename (Guid) var myUniqueFileName = Convert.ToString(Guid.NewGuid()); //Getting file Extension var fileExtension = Path.GetExtension(fileName); // concatenating FileName + FileExtension var newFileName = String.Concat(myUniqueFileName, fileExtension); oAttachment.CaseID = oCaseInfo.ID; oAttachment.AttachmentName = fileName; oAttachment.ModifiedAttachmentName = myUniqueFileName + fileExtension; oAttachment.SetupDate = DateTime.Now; oAttachment.AttachmentPath = newCaseFilePath; // Combines two strings into a path. var filepath = newCaseFilePath + "\\" + newFileName; //var filepath = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "Images")).Root + $@"\{newFileName}"; using (FileStream fs = System.IO.File.Create(filepath)) { file.CopyTo(fs); fs.Flush(); } _db.Attachment.Add(oAttachment); } } } #endregion
@dattatreyakulkarni541
@dattatreyakulkarni541 4 жыл бұрын
I have one que please clear me , why you are assigning book parameter again in bookmodel as same , we can inherit know that class we can access know , what is the problem for inheriting please clear this ,i am going with all your dotnetcore videos
@WebGentle
@WebGentle 4 жыл бұрын
Yes, OfCourse you can inherit the class. My main focus is on dot net core mvc concepts. There are lots of things that you can use/improve in the codebase as per the need.
@dattatreyakulkarni541
@dattatreyakulkarni541 4 жыл бұрын
@@WebGentle Thank you for quick response but really I learnt much from your video thank you so much
@dattatreyakulkarni541
@dattatreyakulkarni541 4 жыл бұрын
Please upload some web api with microservices we are waiting
@ganesha1627
@ganesha1627 3 жыл бұрын
how to use jquery ajax in asp.net core. I am able to use in asp.Net framework but not in core
@victorcaceres3592
@victorcaceres3592 3 жыл бұрын
very good
@momosiafa17
@momosiafa17 3 жыл бұрын
How do I delete individual pictures within the gallery? I know how to delete the whole gallery image but I want to say delete one picture within the gallery? Thank you.
@MuhammadArslan-vx3rv
@MuhammadArslan-vx3rv 3 жыл бұрын
Hy kindly send the link of edit and delete functionality of book details
@kumar_codes
@kumar_codes 4 жыл бұрын
Can we use eager loading...while getting the images url
@vinaydeveloper1369
@vinaydeveloper1369 4 жыл бұрын
Very very helpfull video sir ..
@bl7937
@bl7937 Жыл бұрын
How to restrict file size and and file type?
@asharibkamal1
@asharibkamal1 Жыл бұрын
upload image file name not shown how to do this
@StorySparkInspirations
@StorySparkInspirations 4 жыл бұрын
while displaying the image in carousal , I am getting NullRefrence exception
@WebGentle
@WebGentle 4 жыл бұрын
Kindly download the entire code from GitHub repo and match your code with it. You are missing some small things in your code.
@StorySparkInspirations
@StorySparkInspirations 4 жыл бұрын
@@WebGentle Issue shorted out but I want to display latest added image of my database in carousal.
@WebGentle
@WebGentle 4 жыл бұрын
@@StorySparkInspirations It depends on your LINQ (SQL) query. Whatever records you want to display, just fetch only those from the database and the logic of .cshtml (ie display logic) will be the same.
Upload multiple files in asp net core mvc
10:51
kudvenkat
Рет қаралды 87 М.
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 7 МЛН
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 6 МЛН
File upload in asp net core mvc
23:12
kudvenkat
Рет қаралды 189 М.
.NET 7  💥  - Intro to CQRS and MediatR with ASP.NET Core Web Api
1:06:48
Upload Multiple Images to Database in ASP.Net
6:42
ASPSnippets
Рет қаралды 639
NVIDIA’s New AI: Stunning Voice Generator!
6:21
Two Minute Papers
Рет қаралды 108 М.
Image Upload in React with Asp.Net Core Web API
1:00:54
CodAffection
Рет қаралды 55 М.
I Regret Marrying Him ✅ Learn English Through Stories ✅
9:41
English Stories with Allicia 2
Рет қаралды 16 М.
Players push long pins through a cardboard box attempting to pop the balloon!
00:31