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
Shibly Sadik
NA
167
139k
Error "The input is not a valid Base-64 string..."
Mar 7 2015 2:46 AM
I am getting the follwing error while editing my database..
The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
//My model:
public class Document
{
[Key]
public int DocID { get; set; }
public byte[] ImageData { get; set; }
}
public class ImageContext:DbContext
{
public DbSet<Document> Documents { get; set; }
}
}
//Controller:
[HttpPost]
public ActionResult Edit(int id, Document d, HttpPostedFileBase file)
{
try
{
db.Entry(d).State = System.Data.Entity.EntityState.Modified;
db.SaveChanges();
return RedirectToAction("List");
}
catch
{
return View();
}
}
//My Edit View:
@Html.LabelFor(model => model.ImageData, new { @class = "control-label col-md-2" })
@Html.TextBoxFor(model => model.ImageData, new { type="file",name="file"})
<input type="submit" value="Save" class="btn btn-default" />
I can add,delete image but cant edit...
What can i do ..help please..
Reply
Answers (
3
)
How to URLRewrite in asp.net
how to count the number of radio buttons selected in asp.net