Upload file to Project1 from Project2 in same solution

30 Views Asked by At

I Have a solution that has two projects. Project2 displays a webform to the user having an asp:FileUpload control. The ask is to load this file from project2 to Project1 folder(i.e. /Project1/img)

Any solution will be much appreciated

1

There are 1 best solutions below

1
tooMuchLagWillKillYou On

It's pretty hard to help you since you're not telling us what you have tried. By the way, can't you just call a method of Project1 from Project2? Here's an example, of course it's just a quick explanation of what I mean:

namespace Project2
{
 public void UploadToProject1(IFormFile file)
 {
   Project1Model pj1 = new Project1Model();
   pj1.UploadFile(file);
 }
}

namespace Project1
{
 public class Project1Model
 {
  public void UploadFile(IFormFile file)
  {
   // code to place the file where you want
  }
 }
}