What to do when CefPostDataElement.ElementType is File?

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

What to do when CefPostDataElement.ElementType is File?

Postby gwynjudd » Sun Aug 06, 2017 4:48 pm

Hello,

I'm trying to get some information about a CefRequest, and I've come across this case:

Code: Select all
var postData = request.PostData;
         if (postData != null && postData.Count > 0)
         {
            foreach (CefPostDataElement postDataElement in postData.GetElements()) {
               switch (postDataElement.ElementType)
               {
                  case CefPostDataElementType.Bytes:
                     var bytes = postDataElement.GetBytes();
                     this.WebRequest.GetRequestStream().Write(bytes, 0, bytes.Length);
                     break;
                  case CefPostDataElementType.File:
                     // not sure what to do in this case???
                     var file = postDataElement.GetFile();
                     break;
               }
            }
         }


Looking at the post data element type, what does it mean if the type is file? What does the return type of "GetFile()" indicate? The path to the file?
gwynjudd
Newbie
 
Posts: 6
Joined: Mon Aug 03, 2015 5:22 pm

Re: What to do when CefPostDataElement.ElementType is File?

Postby magreenblatt » Mon Aug 07, 2017 11:44 am

GetFile() will return the file name for file uploads.
magreenblatt
Site Admin
 
Posts: 9837
Joined: Fri May 29, 2009 6:57 pm


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 1 guest