Click here to Skip to main content
15,920,704 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi to all,

Great day.

Is there another option on how to upload file using Jquery
in ASP.NET in vb.net 2010 without using "ajaxfileupload.js"

I hope you could help me on this.
I already searched in google but all was using ajaxfileupload.js.

Thank you in advance and God bless.


Regards,
Jess
Posted

1 solution

You mentioned just one particular upload implementation which you don't have to use, of course.

Another option is using HTML form with method "post" and the input control with type="file".

Also, there is a number of jQuery solutions available. I like this one:
http://blueimp.github.com/jQuery-File-Upload/[^].

It allows to dynamically add files one by one in a convenient way.

You can find some more if you need to: http://bit.ly/XFzw4o[^].

Good luck,
—SA
 
Share this answer
 
Comments
Silver Lightning 17-Jan-13 4:32am    
Thanks sir but still not working out. I need to do it in Jquery. is there any other option using jquery?.
Sergey Alexandrovich Kryukov 17-Jan-13 6:42am    
What is not "working out", exactly?
—SA
Silver Lightning 17-Jan-13 20:34pm    
Hi Sir,

Here is my code which is not allowed to use in our office, especially using the uploadify.swf and swfobject.js

MY CLIENT SIDE CODE:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<link href="_scripts/uploadify.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="_scripts/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="_scripts/swfobject.js"></script>
<script type="text/javascript" src="_scripts/jquery.uploadify.v2.1.4.min.js"></script>
<title>Untitled Page</title>
<script type="text/javascript">
$(document).ready(function() {
$('#fuFiles').uploadify({
'uploader': '_scripts/uploadify.swf',
'script': 'FileUploads.aspx',
'cancelImg': '_scripts/cancel.png',
'auto': 'true',
'multi': 'true',
'buttonText': 'Browse...',
'queueSizeLimit': 3,
'simUploadLimit':2
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div id="fuFiles"></div>
</form>
</body>
</html>


MY CODE BEHIND:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class FileUploads : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
HttpPostedFile uploads = Request.Files["FileData"];
string file = System.IO.Path.GetFileName(uploads.FileName);

try
{
uploads.SaveAs("D:\\UploadedUserFiles\\" + file);

}
catch
{

}
}
}


---
Is there another way that I could only use is the jquery.uploadify only? not the uploadify.swf and swfobject.js?
I hope you could help me on this Sir. Thank you
Sergey Alexandrovich Kryukov 17-Jan-13 21:18pm    
I have no idea what 'uploadify.swf' does and is it related to Adobe flash. I gave you some ideas, and you did not explain what is "not working". Apparently, it does work...
—SA
Silver Lightning 17-Jan-13 23:35pm    
Thanks Sir SA,
Based on my code above, do you have any idea on how could I make it without using the .swf and swfojbect.js? I need to implement uploading file using jquery only in asp.net. I hope someone could help me or direct me to right path. Thank you

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



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