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

Notification

Icon
Error

Options
Go to last post Go to first unread
souljunk  
#1 Posted : Wednesday, August 9, 2006 10:39:19 PM(UTC)
souljunk

Rank: Member

Groups: Member
Joined: 8/9/2006(UTC)
Posts: 9

In the asp.net sample files I read the following:

Code:
//Configure user quota restriction. In real-life application these values should be 
//loaded from server.
iu.addParam("MaxFileCount", "10");
iu.addParam("MaxTotalFileSize", "5242880");

Is there a good example of how to set the ImageUploader parameters from the server. I would like these to be depending on some session variables.

Edited by user Tuesday, February 26, 2008 6:33:35 PM(UTC)  | Reason: Not specified

sunbomb  
#2 Posted : Wednesday, August 9, 2006 11:22:04 PM(UTC)
sunbomb

Rank: Member

Groups: Member
Joined: 9/15/2005(UTC)
Posts: 21

I am assuming that they are suggesting that these values are useful upto a point when set on the client side. When the images are finally uploaded to your server, on the server-side you should also be doing checks for whether they are exceeding quota.
souljunk  
#3 Posted : Wednesday, August 9, 2006 11:26:51 PM(UTC)
souljunk

Rank: Member

Groups: Member
Joined: 8/9/2006(UTC)
Posts: 9

So there is no possibility to set these properties from the server!?
Alex Makhov  
#4 Posted : Thursday, August 10, 2006 1:40:57 PM(UTC)
Alex Makhov

Rank: Advanced Member

Groups: Member
Joined: 8/3/2003(UTC)
Posts: 998

Hello,

Here is the code (C#, User Quota sample):

Code:
<script runat="server">
int serverSideMaxFileCount = 30;
int serverSideMaxTotalFileSize = 4096;
</script>
…
iu.addParam("MaxFileCount", "<% Response.Write(serverSideMaxFileCount); %>");
iu.addParam("MaxTotalFileSize", "<% Response.Write(serverSideMaxTotalFileSize); %>");

Edited by user Tuesday, February 26, 2008 6:33:56 PM(UTC)  | Reason: Not specified

Sincerely yours,

Alex Makhov

UserPostedImage Follow Aurigma on Twitter!

souljunk  
#5 Posted : Thursday, August 10, 2006 4:04:19 PM(UTC)
souljunk

Rank: Member

Groups: Member
Joined: 8/9/2006(UTC)
Posts: 9

That works great! Thank you!
Fedor  
#6 Posted : Sunday, January 27, 2008 7:00:49 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,660

Thanks: 5 times
Was thanked: 76 time(s) in 74 post(s)
You can try to use Image Uploader ASP.NET Control.

Her is the sample code:

Code:
<%@ Page Language="VB" AutoEventWireup="true" %>

<%@ Register Assembly="Aurigma.ImageUploader" Namespace="Aurigma.ImageUploader" TagPrefix="cc1" %>
<script runat="server">
Private _maxFileCount As Integer = 30
Private _maxTotalFileSize As Integer = 4096

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
		ImageUploader1.MaxFileCount = _maxFileCount
		ImageUploader1.MaxTotalFileSize = _maxTotalFileSize
End Sub
</script>

<!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">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
		<cc1:ImageUploader id="ImageUploader1" runat="server"
			height="475px" width="732px"></cc1:imageuploader>    
    </div>
    </form>
</body>
</html>

Best regards,

Fedor Skvortsov

Users browsing this topic
Guest
Similar Topics
Server Side Code for Dynamic Directory (Discussions – ActiveX/Java Uploader)
by Micro 8/13/2006 1:17:05 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.