Click here to Skip to main content
15,844,673 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I made a website in that i am using fileupload control of .net but this control not working in mobile. I can't browse - like in PC to upload file - in mobile.

So how do i upload file from mobile.

Thanks in advance.
Posted
Comments
Try with <input type="file"> HTML Control.
girishkalamati 27-Nov-14 6:24am    
hope he have question not about how to do but not able to do ? with the very same kind of form element he would be using .... unable to open up sort of file explorer window as in MOBILE ?
girishkalamati 27-Nov-14 6:30am    
Folder selection

It is possible to select a complete folder structure, though this is currently only supported by Google Chrome.
To enable this feature, the following vendor-specific directory attributes have to be added to the file input field:

<input type="file" name="files[]" multiple directory webkitdirectory>

1 solution

try

1) http://demos.telerik.com/kendo-ui/upload/index[^]
2) web client methods from .net 4.5

3) you can go with any Jquery behind to bring up the seperate window to upload file with check on file extension , non malicious file via JQuery

thank u
 
Share this answer
 
Comments
c.chirag 28-Nov-14 6:46am    
My question is i have apk file but the page is aspx page. it's work fine in Mobile's browser but when i use this apk file it's not working... i am using phonegap script as given below :

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Upload File</title>
<%--<script type="text/javascript" charset="utf-8" src="cordova-1.5.0.js"></script>--%>
<script src="cordova-1.5.0.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript" charset="utf-8">

// Wait for PhoneGap to load
//
document.addEventListener("deviceready", onDeviceReady, false);

// PhoneGap is ready
//
function onDeviceReady() {
//alert("Function call");
// Retrieve image file location from specified source
navigator.camera.getPicture(uploadPhoto,
function (message) { alert('get picture failed'); },
{ quality: 50,
destinationType: navigator.camera.DestinationType.FILE_URI,
sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY
}
);

}

function uploadPhoto(imageURI) {
var options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);
options.mimeType = "image/jpeg";

var params = new Object();
params.value1 = "test";
params.value2 = "param";

options.params = params;

var ft = new FileTransfer();
ft.upload(imageURI, "http://some.server.com/upload.php", win, fail, options);

}

function win(r) {
console.log("Code = " + r.responseCode);
console.log("Response = " + r.response);
console.log("Sent = " + r.bytesSent);
}

function fail(error) {
alert("An error has occurred: Code = " = error.code);
console.log("upload error source " + error.source);
console.log("upload error target " + error.target);
}

</script>

</head>
<body >
<form id="form1" runat="server">
<div>

Example

<p>Upload File</p>
<br />
<br />
<asp:Button ID="BtnUpload" Text="UploadFile" runat="server" OnClientClick="onDeviceReady()" />
</div>
</form>
</body>
</html>
girishkalamati 28-Nov-14 13:15pm    
hi chirag .... u had not mention the very same in the question clearly...
c.chirag 29-Nov-14 2:25am    
sorry for that but right now i m in stuck

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900