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
|
|
|
|
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.
|
|
|
|
Rank: Member
Groups: Member
Joined: 8/9/2006(UTC) Posts: 9
|
So there is no possibility to set these properties from the server!?
|
|
|
|
Rank: Advanced Member
Groups: 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 |
|
|
|
|
Rank: Member
Groups: Member
Joined: 8/9/2006(UTC) Posts: 9
|
That works great! Thank you!
|
|
|
|
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
|
|
|
|
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.