Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Images are Not Uploading on Appaharbor Ap.net mvc

ateeq.ranglerz's Avatar

ateeq.ranglerz

20 Feb, 2018 07:00 PM

Images are not Uploading.
I'm using this code;
ads.image = collection["ImageFile"]; string fileName = Path.GetFileNameWithoutExtension(ImageFile.FileName); string extention = Path.GetExtension(ImageFile.FileName); fileName = fileName + DateTime.Now.ToString("yymmssff") + extention; ads.image = "~/Images/" + fileName; fileName = Path.Combine(Server.MapPath("~/Images/"), fileName); ImageFile.SaveAs(fileName); Image Path Save in Database but image are not save in loaction.
When Upload image on Appharbor this error are showing.
Could not find a part of the path 'D:\Users\apphba31278be216879\app_PublishedWebsites\WebMatrixWebsite\Images\60592451_m_018260873.jpg'.

  1. Support Staff 1 Posted by rune on 23 Feb, 2018 09:19 AM

    rune's Avatar

    Hi,

    It looks like the deployed application doesn't have a folder named "Images" in the root directory (you can download the build to inspect what AppHarbor deploys, and since this build doesn't include a solution file the website root directory is nested under _PublishedWebsites\WebMatrixWebsite\).

    Try and commit a file to that repository, or make sure it's created prior to writing files to it. You'll also need to enable file system write access on your application's "Settings" page. That'll allow write access to the application folder, but please note that it should be stored elsewhere as the filesystem is wiped on each deploy.

    Best,
    Rune

  2. rune closed this discussion on 23 Feb, 2018 09:19 AM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac