Giter VIP home page Giter VIP logo

cefsharp's People

Contributors

amaitland avatar mattkol avatar xjfnet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cefsharp's Issues

I'd suggest populating the `Stream` with an error message otherwise you'll end up with a blank page displayed to the user if they request a file that's not found.

I'd suggest populating the Stream with an error message otherwise you'll end up with a blank page displayed to the user if they request a file that's not found.

You can use ResourceHandler.GetMemoryStream to turn a string into a stream.

https://github.com/cefsharp/CefSharp/blob/c1a4db20fde01a8464130384706993890838084a/CefSharp/ResourceHandler.cs#L333

Originally posted by @amaitland in #1 (comment)

How interception request to get JS upload binary file content

I'm using cefsharp to host a web page that uses js to request a custom protocol Url and request interception in C#, but I can't get the binary content of the file。
js code:
function upload() {
// Form Data
var postData = new FormData();

        var fileSelect = document.getElementById("fileSelect");
        if (fileSelect.files && fileSelect.files.length == 1) {
            var file = fileSelect.files[0]
            postData.set("file", file, file.name);
        }

        axios.post('http://icreate.com/admincontroller/upload', postData)
            .then(response => {
                console.log(response.data)
            })
            .catch(error => {
                console.log(error)
            });
    }

C# code
public class DefaultRequestSchemeHandler : ResourceHandler
{
...
public override CefReturnValue ProcessRequestAsync(IRequest request, ICallback callback)
{
...
var postDataElements = request?.PostData?.Elements;
...
}
}
post data:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.