Function userpage(ByVal form As FormCollection, ByVal file As HttpPostedFileBase) As ActionResult Dim mn As MVBC.userpage = New userpage() Dim q As String = mn.resume1 mn.name = form("txtName") mn.phn = form("txtPhn") mn.highestedu = form("Education") mn.gender = form("Gender") mn.field = form("Field") mn.Email = form("txtEmail") Dim image As String = form("file1") Dim resume1 As HttpPostedFileBase = Request.Files("resume") Dim filetoUpload As HttpPostedFileBase = Request.Files("file1") If filetoUpload.FileName <> "" Then Dim ext As String = System.IO.Path.GetExtension(filetoUpload.FileName).ToLower() If ext <> ".jpg" AndAlso ext <> ".png" AndAlso ext <> ".jpeg" Then ViewBag.q = "Please Upload Valid Format Image" Return RedirectToAction("welcome", "Seema") Else Dim imagename As String = System.IO.Path.GetFileName(filetoUpload.FileName) ' Dim phyisal As String = Server.MapPath(Convert.ToString("~/Content/images/") & imagename) Dim path As String = System.IO.Path.Combine(Server.MapPath("~/Content/images"), imagename) filetoUpload.SaveAs(path) mn.filetoUpload = filetoUpload.FileName ' file.SaveAs(phyisal) ViewBag.q = "File Uploaded Successfully" End If End If Dim ext1 As String = System.IO.Path.GetExtension(resume1.FileName) If (ext1 <> ".doc") AndAlso (ext1 <> ".docx") AndAlso (ext1 <> ".pdf") Then ViewBag.q = "Please Upload Valid Format Resume" Return RedirectToAction("welcome", "Seema") Else mn.resume1 = mn.Email & resume1.FileName Dim resumenamwe As String = System.IO.Path.GetFileName(resume1.FileName) ' mn.resume1 = resumenamwe Dim respath As String = System.IO.Path.Combine(Server.MapPath("~/Content/Resumes"), mn.resume1) resume1.SaveAs(respath) End If ViewBag.m1 = mn ViewBag.xm = Createxml(mn) Return View() End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)