0

I am using radasyncupload on my asp.net page. After uploading the files, I need to store them to database as byte array. So, after uploading, on a button click, through Ajax call, I want to store the files currently in the temporary folder to database. But I found that the file names in the temporary folder is not the same as that I uploaded. So, how can I upload these files using Ajax call if the file names do not match?

Chindu Krishna
  • 411
  • 5
  • 13

1 Answers1

0

After the files are uploaded, you can get their name, using this code:

if (radAsyncUpload.UploadedFiles.Count >= 1)
{
    foreach (UploadedFile file in radAsyncUpload.UploadedFiles)
    {
        // gets the name/path of the uploaded file on the client computer,
        // e.g. "c:\temp\image.gif"
        var origName = file.FileName;
M4N
  • 94,805
  • 45
  • 217
  • 260
  • since after upload, I am using Ajax call, how will I get "radAsyncUpload" object? It will only be available if the page life cycle happens, right? – Chindu Krishna Feb 19 '14 at 09:22
  • AJAX is part of the page lifecycle, it is a postback that only returns parts of the page, not the entire page, that's it. You can refernce controls in the code-behind just like in normal postbacks – rdmptn Feb 25 '14 at 14:09