Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. <div class="form-group row">
  2.  
  3.  
  4.  
  5.  
  6. <label class="col-5">File1 :</label>
  7. <div class="col-7">
  8.  
  9.  
  10.  
  11.  
  12. <input type="file" name="file1" class="form-control no-border" />
  13. </div>
  14.  
  15.  
  16.  
  17. </div>
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. <div class="form-group row">
  25.  
  26.  
  27.  
  28.  
  29. <label class="col-5">File2 :</label>
  30.  
  31.  
  32. <div class="col-7">
  33.  
  34.  
  35.  
  36.  
  37. <input type="file" name="file2" class="form-control no-border" />
  38.  
  39.  
  40.  
  41.  
  42. </div>
  43.  
  44.  
  45.  
  46.  
  47.  
  48. </div>
  49.  
  50. var fileResume = string.Empty;
  51. var fileContract = string.Empty;
  52. try
  53. {
  54. if (Request.Files != null && Request.Files.Count > 0)
  55. {
  56. var path = @"uploadSpeaker";
  57. if (!System.IO.Directory.Exists(Server.MapPath(path)))
  58. {
  59. System.IO.Directory.CreateDirectory(Server.MapPath(path));
  60. }
  61.  
  62. for (int i = 0; i < Request.Files.Count; i++)
  63. {
  64. if (Request.Files[i].ContentLength > 0)
  65. {
  66. var file = Request.Files[i];
  67. var fileName = string.Concat(Guid.NewGuid(), file.FileName);
  68.  
  69. var savePath = string.Concat(path, "\", fileName);
  70.  
  71. if (Request.Files.Keys[i] == "Resume")
  72. {
  73. fileResume = savePath;
  74. }
  75. else
  76. {
  77. fileContract = savePath;
  78. }
  79. file.SaveAs(Server.MapPath(savePath));
  80. }
  81. }
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement