Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
derekmhart  
#1 Posted : Tuesday, March 16, 2010 11:26:43 AM(UTC)
derekmhart

Rank: Member

Groups: Member
Joined: 3/13/2010(UTC)
Posts: 13

I am trying to work with your samples on how to use a progress indicator when uploading files. I am fairly new to asp.net, so bare with me.

I am in your ConcurrentUpload example, looking at default.aspx

In your code, you have this as a javascript function:

function ImageUploader1_Progress(Status, Progress, ValueMax, Value, StatusText)

And in that function you have this:

var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);

Now I don't want to create the control right there in the javascript. I want to create it in the html markup, such as:

<div>

<cc1:ImageUploader ID="ImageUploader1" runat="server" Height="475px"

Width="700px" OnClientAfterUpload="ClientAfterUpload">

</cc1:ImageUploader>

<br />

</div>

The reason I want to do this is to be able to set settings there, and more importantly, so my aspx.vb code can know the control is there, and work with it.

Private Sub ImageUploader1_FileUploaded(ByVal sender As Object, ByVal e As Aurigma.ImageUploader.FileUploadEventArgs) Handles ImageUploader1.FileUploaded

I tried to change the javascript line from:

var iu = new ImageUploaderWriter("ImageUploader1", 650, 400);

To:

var imageUploader = getImageUploader("ImageUploader1");

But that does not seem to work.

Here is the code I am using... I probably have it structured incorrectly.

Please tell me what items might not be correct here. I am really unsure about the style type="text/css" area, if the pound sign # should be there.

<body>

<form id="form1" runat="server">

<input type="hidden" id="StopUploading" runat="server"/>

<div>

<cc1:ImageUploader ID="ImageUploader1" runat="server" Height="475px"

Width="700px" OnClientAfterUpload="ClientAfterUpload">

</cc1:ImageUploader>

<br />

</div>

<div id="StatusBar"></div>

</form>

</body>

</html>

<script type="text/javascript" src="iuembed.js"></script>

<script type="text/javascript">

// var iu = new ImageUploaderWriter("ImageUploader", 700, 475);

var imageUploader = getImageUploader("ImageUploader1");

iu.fullPageLoadListenerName="SetStatusText";

iu.addEventListener("FolderChange", "SetStatusText");

iu.addEventListener("UploadFileCountChange", "SetStatusText");

iu.writeHtml();

function ClientAfterUpload(Html)

{

}

function SetStatusText() {

var imageUploader = getImageUploader("ImageUploader1");

var statusBar = document.getElementById("StatusBar");

statusBar.style.visibility = "visible";

var cnt = imageUploader.getPaneItemCount("FolderPane");

var text = cnt + " item(s)";

cnt = imageUploader.getUploadFileCount();

statusBar.innerHTML =

(cnt > 0) ? text + ". " + cnt + " selected for upload" : text;

}

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<title>Untitled Page</title>

<style type="text/css">

#StatusBar {

width: 650px; /* width of Image Uploader control/applet */

visibility: hidden; /* hide the status bar by default */

text-align: right;

font-weight: bold;

border: solid black 1px;

background: white;

padding: 3px;}

</style>

</head>

Edited by user Tuesday, March 16, 2010 10:24:24 PM(UTC)  | Reason: Not specified

Tamila  
#2 Posted : Wednesday, March 17, 2010 12:18:59 AM(UTC)
Tamila

Rank: Advanced Member

Groups:
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
Hello Derek,

The code you posted here is incorrect at all.

First of all you should decide for yourself which method of Image Uploader embedding you want to use: ASP.Net control or using Embedding Scripts library. In the code above you have mix of to method. That is why you have problems.

Please read the article below about these methods:

Embedding Image Uploader into Life Cycle of Project

In this case I recommend you to investigate the samples more carefully:

  • [Aurigma installation folder]\Samples\ASPNET_VB\ConcurrentUpload\

    Here you can find Concurrent Upload Sample which was wrote using ASP.Net control.

  • [Aurigma installation folder]\Samples\ASPNET_IUEmbed_VB\ConcurrentUpload\

    I this folder you can find the same sample but here we used Embedding Scripts library.

See also:

Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!

derekmhart  
#3 Posted : Wednesday, March 17, 2010 3:21:46 AM(UTC)
derekmhart

Rank: Member

Groups: Member
Joined: 3/13/2010(UTC)
Posts: 13

OK, I am sticking with the asp.net control. But in the FileUploaded event, that is where I can detect that the user cannot upload any more files because the file storage capacity is exceed. I know exit the routine at that point, the the FileUploaded event will keep firing, and I want it to stop.

1) How do I pass this info to the client to do a javascript alert that the file capacity is exceeded?

2) How do I remove all files from the upload pane at that point, in the asp.net code server side?

Edited by user Wednesday, March 17, 2010 3:55:49 AM(UTC)  | Reason: Not specified

Tamila  
#4 Posted : Wednesday, March 17, 2010 3:23:28 PM(UTC)
Tamila

Rank: Advanced Member

Groups:
Joined: 3/9/2008(UTC)
Posts: 554

Was thanked: 1 time(s) in 1 post(s)
Hi,

You can find my answer in your another post.

Aurigma Support Team

UserPostedImage Follow Aurigma on Twitter!

Users browsing this topic
Guest (2)
Similar Topics
Uploading Progress Indicator (Discussions – Graphics Mill)
by Jake Rizzo 10/10/2013 6:07:12 AM(UTC)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.