RTC Forums
November 24, 2024, 09:49:33 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Multiple file uploads (using multipart/form-data)  (Read 4628 times)
Dany
RTC License++
*****
Posts: 69


« on: September 04, 2014, 12:55:27 PM »

Hello!

I put an input element of type file on my form and add the multiple property to the element. As the request is processed i can count the number of files using ItemCount and access the filenames using ItemValue (i think). But i cannot find a GetFile function taking an integer index parameter so i do not know how to write the individual files to disk/stream (i'd like to process them one at a time). Browsers seem to name the multiple elements the same so using GetFile('file', 'Name1') does not seem to do it. Also Element['file', 0] returns a string.

TIA,

/Dany
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: September 04, 2014, 06:11:23 PM »

OK. Download the latest RTC SDK update (v6.38).

Now, multiple file uploads using the "multiple" attribute are also supported and the "QuickStart/BrowserUpload" example is updated to demonstrate how to use this new feature.

In short, you can now check how many files were uploaded by using the "ElementCount" property, access all file names through the "Element" property and permanently store files using the "GetFile" method, which has a new "FileIndex" parameter to speficy which file you want to access (index starting at 0).

Best Regards,
Danijel Tkalcec
Logged
Dany
RTC License++
*****
Posts: 69


« Reply #2 on: September 04, 2014, 06:18:17 PM »

WOW Danijel!

I'll check it out tomorrow and during the weekend. This was really really nicely done of you.

You see, i'm very reclusive against parsing manually. And even though i just found out i could use the HTML5 FormData object to transfer from the input object to file-entries in a new the multipart with varying names the "API" that my server exposes will not be 100% cool for others who want to communicate with it.

Thanks a BUNCH!

Regards,

/Dany
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 16 queries.