dimanche 2 octobre 2016

why isn't my path true in Customer host?

I write below code for uploading image in my app.I set path for uploading image. below code is full correctly in my system and company's server. but when i publish customer site . in host can't find this path and produce HTTP ERROR 404.0 -NOT Found.

 `string pic = System.IO.Path.GetFileNameWithoutExtension(model.ImageUpload.FileName) + Guid.NewGuid() + System.IO.Path.GetExtension(model.ImageUpload.FileName);
                    string path = System.IO.Path.Combine(
                                           Server.MapPath("~"), "Areas/Administrator/uploads/", pic);
                    string PicPath = System.IO.Path.Combine("/Areas/Administrator/uploads", pic);
                    PicPath = PicPath.Replace("\\", "/");
                    model.ImageUpload.SaveAs(path);

                    bImageUpload.Inser(new Shared.Entities.SMP.ImageUpload
                    {
                        Title = model.Titel,
                        Lang = CultureHelper.GetLangFromCulture(),
                        ImageUrl = PicPath
                    });`

Aucun commentaire:

Enregistrer un commentaire