Directory for Images on Server gets overwritten during deployment

Discussion in 'Site Programming, Development and Design' started by Kire, Feb 2, 2018.

  1. I am trying to create a directory on my site that hosts pictures. It goes under the E:\web\mywebsite directory. I'm using Visual Studio 2017 and using MSDeploy to publish. I can't seem to stop overwriting a directory the app creates on the server each time I deploy.

    For example, if the app creates (dynamically if not found) a directory "E:\web\mywebsite\Images" and them uploads images in there, when I deploy again, the directory and the images in there are gone.

    Should the Images directory be put in another folder somewhere so the deploy will not overwrite them? If so, where should I put them? I don't think I want them in an FTP folder as just the app is using this. I don't think I want to use AppData directory either unless that is what others come up with as I can exclude AppData directory I think on the MSDeploy publish.

    Thank you.
  2. Elshadriel

    Elshadriel Winhost Staff

    Hi Kire,

    I'm afraid I don't think that's possible when deploying using Web Deploy as its set to overwrite any files in the deployment directory. The work around is to use FTP to publish your files.
  3. Thanks. I figured that would be my backup.

Share This Page