1

This is for an intranet application. Users need to upload a file via a webpage and be able to access it through a web page, preferably the same one. It is basically working but I have a couple of issues. If I create the 'Upload' folder in the site when I publish the folders and contents get overwritten. If I have them upload to a folder outside of the site I can't link to it. Is there a way to keep Visual Studio 2008 from overwritting the folder and files --OR-- being able to link to files in the folders outside of the website? I would be elated to be able to do both.

My code works fine, my design may not. It doesn't seem abnormal to do something like this so I would assume I am doing something stupid, or just missing something. Visual Studio's erase everything before publish kills me, I must be missing something.

Thanks for your help, it is greatly appreciated.

  • Have you tried to check the option: "Replace matching files with local copies"? Not the "Delete files prior publishing". – mipe34 Feb 01 '13 at 00:26
  • When I click publish all I have is four check boxes (all precompiled .., use fixed ..., emit debug..., and enable strong ...). I am using VS2008 Pro (9.0.30729.1) with SP1. Would that work anyway? I want the remote files in the Upload folder to remain, I don't want the local files for the Upload folder to get published because those will only be present from debugging/testing. It looks like I might need to copy the site but I prefer to publish because another developer could come along and click the publish button. Your response is GREATLY appreciated, thanks for taking the time to reply. – Display Name Feb 01 '13 at 15:11
  • I found why I am not getting the options you mention. It's the difference between the project being a web application and a web site. I guess I still have a design question though. How would anyone else create a location for uploaded files? I have done this before but not with Visual Studio. To test and make the files accessible via the site you need it in the project but if its there then Vis Studio overwrites. Also, permissions will get overwritten. You can upload outside the site but then can't link to them. – Display Name Feb 01 '13 at 15:37
  • Aha, I did not noticed, that you are talking about websites. Well, I would suggest to convert your web site to web application. It will save you lot of pain. Anyway, look at this similar issue: http://stackoverflow.com/questions/650875/exclude-files-from-web-site-publish-in-visual-studio – mipe34 Feb 01 '13 at 15:55
  • Sweet, I'll be aware of this next time. It is something I have glazed over and just did not realize there was a difference. I was going to use copy but it wants Frontpage Server Extensions installed on the server, the last I knew those were a security risk. I ended up creating a separate site. The paths are still built dynamically and they can still be browsed. Probably not the standard approach but it seems like it'll work. Thanks for the bump, I'd give you one but I don't have enough street cred yet, lol. ;) Thanks for your help. – Display Name Feb 01 '13 at 16:51
  • Ah ha, I'll give you a bump when I hit 15! I'm at 6 now, how long could that take? I'll be back! muu ha ha ha – Display Name Feb 01 '13 at 17:27
  • I have posted it as answer, so you can accept it (or give vote up when you reach 15 rep points) if it helped you. *You can get reputation by asking good questions and posting good answers :-), depends on your activity...* – mipe34 Feb 01 '13 at 18:29

1 Answers1

0

Well, I would suggest to convert your web site to web application. It will save you lot of pain. Visual studio IDE treats Web Application in more friendly way.

Anyway, look at this similar issue:

Exclude files from web site publish in Visual Studio

And here is great comparison of Web site and Web application project:

ASP.NET Web Site or ASP.NET Web Application?

For me there are no doubts.

Community
  • 1
  • 1
mipe34
  • 5,596
  • 3
  • 26
  • 38