Telegram web apps for bot: input type="file" multiple not work - telegram

I tried to upload multiple files with telegram web apps for bot. It worked fine on IOS and PC but not on android, it can't select multiple files (Nothing happen after select multiple files)
My telegram version (android): v9.0.2 (2808)
Any suggest are welcome!
<!DOCTYPE html>
<html>
<head>
<title>demo</title>
</head>
<body>
<form method="post" enctype="multipart/form-data">
<label for="files">Select files:</label>
<input type="file" name="files[]" multiple="multiple"><br><br>
<input type="submit">
</form>
</body>
</html>

Related

Classic asp Request Form error 80004005

I having problem when trying to post data to my ASP file with integrated pipeline.
ASP CODE:
<%
Response.Write request.form("StatusDate")
%>
HTML CODE:
<!DOCTYPE html>
<html>
<body>
<form action="myASPFile.asp" method="post">
StatusDate: <input type="text" id="StatusDate" name="StatusDate"><br>
<input type="submit" value="Submit">
</form>
</body>
</html>
the page will show :error '80004005'
When I change the integrated mode to Classic Code, the request form is working.
What is the setting that I have missed out in integration mode in order to do the request form for post data

how to get Uploaded multiple files using multiple attribute in spring mvc

provide some sample code to upload multiple files in spring framework.
when i search solution for this everyone wrote jsp page like this :
<input type='file' name='files[]' multiple />
but this was not the scenario what i am really want
Here my jsp page code : multiFileSelect.jsp
<%# page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<form action="upload" enctype="multipart/form-data" method="post">
<input name="files" type="file" multiple/>
<button type="submit"/>
</form>
</body>
</html>
Please help me...
I think Chann has given the solution to your question.
<input type="file" name="img" multiple>
for more general one
<input type="file" multiple/>
Since you have asked an example usage of that, please refer this SO question (I don't know why you missed this) and the sample code example by SO user Costa.

IFrame in content script. How to communicate with main.js?

My Firefox add-on opens Fancybox (type: "iframe") from a content script (page-mod). In the Fancybox I show my own HTML page (my_fancybox_stuff.html) that is located in my own server.
Now, from the my_fancybox_stuff.js (javascript of my_fancybox_stuff.html), can I send a message to the add-on's main.js? Or to the content script that opened the Fancybox?
I was hoping the global 'self' object to be accessible from my_fancybox_stuff.js as it is accessible from the content script that opened the Fancybox.
I am interested to hear about any potential workarounds to get this done.
In Chrome extension this is trivial. In my_fancybox_stuff.js I can call chrome.extension.sendMessage() and it works.
Thanks in advance!
EDIT: Adding some code to clarify my case. Simplified the code to save folks' time on reading it. This is simple as hello world.
From the contents_scipt.js (injected with page-mod) I call:
$.fancybox.open(
{
// Some irrelevant Fancybox options hidden for clarity
href:"http://www.mysite.com/my_fancybox_stuff.html
type: 'iframe'
}
);
my_fancybox_stuff.html would look something like this:
<!doctype html>
<head>
<meta charset="utf-8">
<title></title>
<script src="js/jquery.js"></script>
<script src="js/my_fancybox_stuff.js"></script>
</head>
<body>
<div id="my-wrapper">
<div id="my-form-div">
<form id="my-form" action="#">
<div>
<div><p>Name</p></div>
<div><input id="fullname" type="text" name="fullname" value=""></div>
</div>
<div>
<div><p><a id="my-button" href="#">Press this</a></p></div>
</div>
</form>
</div>
</div>
</body>
In my_fancybox_stuff.js, when button ("my_button") is pressed, I want to send out a message containing the value of the input field ("fullname") and listen it in content_script.js.
Yes, your my_fancybox_stuff.js can communicate with your add-on's content script using postMessage ().
See the documentation and examples at MDN.

Long delay when submiting form onload?

To post data to a remote payment server, my website generates a page that looks like this:
<html>
<head>
</head>
<body onload="document.form1.submit()">
<form name="form1" method="post" action="https://secure.paymentsite.com/purchase" >
<input type="hidden" name="instId" value="1">
<input type="hidden" name="itemId" value="23">
<input type="hidden" name="currency" value="USD">
<input type="hidden" name="amount" value="9">
</form>
</body>
</html>
I generate a page like this so that I can log the choice the user has made to my database before redirecting the user to an external site to pay.
However, it takes around 6 seconds for the form to be submited once the page loads. During this time, the user is displayed a plain white screen, and may wonder if the website is broken.
Is it possible to make a form that submits as soon as the page has loaded?
jquery's $(document).ready(function(){....} executes when the DOM has finished loading. That would be one of many solutions.

Difference Between Web Page and Web Form

I want to know the difference between Web Page and web Form
A web form produces a web page. Or many web pages. A web page is just a loose concept of a "document". A web form is a type of object which can produce web pages.
WebPage is a document / information resource that is rendered usually as HTML/XHTML on World Wide Web and is accessed through Web Browser.
Whereas, Web Form is a document where you can design and develop the Web Page, Web Form usually provides features which can enable a user to develop a Web Page.
<html>
<head>
<title>my web page</title>
</head>
<body>
<b>my web page. it does not have any html controls like textbox and button.</b>
</body>
</html>
<html>
<head>
<title>my web form</title>
</head>
<body>
<form action="mySecondPage.htm" method="post">
<b>my web form. it may contains html controls like textbox and button.</b>
<input type="text" id="txtUserName" /><br/>
<input type="submit" value="Submit User Name" />
</form>
</body>
</html>

Resources