0

Each time the file is loaded, the pd changes, how can I add these pds to an array?

protected void btnUpload_Click(object sender, EventArgs e)
    {
        if (dlg.HasFile)
        {
                string path = Server.MapPath("/upload/");
                dlg.SaveAs(path + dlg.FileName);
                lblUpload.Text = "Uploaded";
                string pd = path + dlg.FileName;
                ....
         }
      }
Aycan Candar
  • 63
  • 1
  • 9
  • Each time the file is loaded `pd` variable is created again and again, if you want to add paths, you should store these values first. Maybe you can add hidden field on client side update values by every `btnUpload_Click`. – Selim Yildiz Jul 13 '20 at 20:43
  • Another question I have explained in detail, I want to delete the uploaded files after the user use, how can I do this https://stackoverflow.com/questions/62879134/how-to-delete-files-after-upload-asp-net – Aycan Candar Jul 14 '20 at 12:44

0 Answers0