4 ms·
filepicker.getFile(mimetype, callback(url){alert(url);}); I feel dumb saying this, but I don't understand the example code. Why do I have to give Filepicker a
by bluesnowmonkey 14y ago
filepicker.getFile(mimetype, callback(url){alert(url);});
I feel dumb saying this, but I don't understand the example code. Why do I have to give Filepicker a mimetype? I would expect it to tell me what MIME type the user uploaded. Are you setting the type of file the user is allowed to upload? Can you whitelist several at once? Are you only expecting images, or does this work for PDFs, etc?
Also, is this javascript? I think 'callback' should be 'function'.
- liyanchang 14y agoThat's correct. You get to whitelist the files we allow the user to choose. The mimetype should work for things like "text/" or "" if you want multiple, but I'll look into adding something that takes a list, if that's something that you would want. Thanks for catching that typo. We were debating if just to write 'callback' or to have a simple function that calls alert. We ended up with neither :D Fixed.