I have a requirement where I will be using asyncupload in a pop up window in gridview. I need to save attachments added for each row in a temp folder with someUniqueID I have. And when user click on Save button outside the grid, I will be moving all these files to permanent location. The issue is with modifying temporary folder location dynamically. I want to change the temp folder location when I bring pop-up window by clicking on a button in a row. I do not want to move those files to permanent location until user clicks on save button that is outside grid. I am using radgrid with soma static columns and some dynamic columns.
4 Answers, 1 is accepted
The files that are saved into the temporary folder can not get mixed up. Each file in temporary folder has a unique name, which is formed by the original name and the current time stamp. For example:
if you upload "telerik.png" it will be uploaded to temporary folder with name: "1386335690530telerik.png". This means that you can upload one file from two different uploads and there will be no problem to save it from both uploads.
Please find the attached sample.
Let me explain again.
My Grid will have testcases listed in each row with a testcaseid. I will be changing the status of testcases to pass/fail/NA. While changing status, I will also add some files to it. Once I am done with changing status and attaching files for all tests, I will click on save button. Then all these attachments should go to folders with their respective testcaseids. I do not want them to be going to some single folder and get mixed up. I hope you understood my requirement now.
If I add attachments to testcases with ID 10000, 10001 and click on save button. I am expecting to move files attached to 10000 testcaseID to go into a folder named attachments/testcases/10000
and files attached to 10001 to go into folder attachments/testcases/10001. For this reason only, I need identifier for all the files I am attaching to. and I want to control that identifier.
Please let me know if it is possible to know the random number that is attached to file name while saving that file to temp folder.
The example you attached will be moving all the files to single target folder and I do not want that thing to happen. I want files to be moving to different folders.
You don't need to know the Temporary File name. I would suggest that you handle the OnFileUploaded event and store every file into the appropriate folder:
Sample is attached.
I have similar question. In my case i want to give a temporary path (that i get from server) and permanent location(that i get from server as well). Basically, i have a grid with column of upload buttons which determines the temporary location and permanent location depending on row. I cannot seem to set temporaryfolder in "OnLoad" i can do TargetFolder in OnFileUploaded Event. I was wondering if there is a way to set TemporaryFolder during page load?
Moreover, is it possible to initiate FileUpload to Target folder from server side? Because i have pair of files. I want to select A to temporary location, B to temp location but save them to target location when i click upload RadButton. I encountered some problem with that such as file name is available via FileUploadedEventArgs and not via control like with asp:FileUpload. I want to prevent move to target on postback and only occur when i click the RadButton.