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

Notification

Icon
Error

3 Pages123>
Options
Go to last post Go to first unread
Alex Makhov  
#1 Posted : Monday, January 21, 2008 8:25:56 PM(UTC)
Alex Makhov

Rank: Advanced Member

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

Note: ASP.NET Control is a part of Upload Suite SDK now.

Please read the documentation for more info.



Project information

Project name: Image Uploader ASP.NET Control.
Authors: Fedor Skvortsov, Alex Makhov.
Project goal is to simplify Aurigma Image Uploader usage while developing ASP.NET applications.
Platform: ASP.NET.
Language: C#.

Introduction

Hello,
Let me show you the new helper control from Aurigma. We have created it to make the life of ASP.NET developers easier.

This control is an ASP.NET server control which allows a developer to configure ImageUploaderWriter object in more usual way. You just drop this control onto the page and specify particular property values you need in Properties window. Then this control creates an appropriate html-code. That's all!

So let's do it step by step from blank solution.

Step1. Create an ASP.NET web application

1. In your Visual Studio 2005 select File->New->Project.
2. In New Project dialog select Visual C#->Web->ASP.NET Web Application.
3. Specify the web applicftion name or leave default WebApplication1.

UserPostedImage

Step2. Add control reference to the toolbar

1. Download the compiled version of Image Uploader ASP.NET control (control) from the link in attachments section.
2. Right-click the Toolbox pane and select Choose Items menu item.
3. In the Choose Toolbox Items click Browse button and specify the location of file Aurigma.ImageUploader.dll.
As a result you will have the following item in the list:

UserPostedImage

Step 3. Add control to the page

That's my favorite step :) Just drag-n-drop ImageUploader item from Toolbox pane to your page.

UserPostedImage

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<%@ Register Assembly="Aurigma.ImageUploader" Namespace="Aurigma.ImageUploader" TagPrefix="cc1" %>

<!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="350px" Width="630px" OnFileUploaded="ImageUploader1_FileUploaded" ShowDebugWindow="True" />
    </div>
    </form>
</body>
</html>



Step 4. Configure control properties

Select the control in Designer. In Properties pane you will see the list of control properties most of which will be applied to Image Uploader itself. The meaning of almost all of these properties can be found in the Image Uploader online documentation. See API Reference or Helper Script Reference for additional information.

UserPostedImage

Step 5. Copy Image Uploader redistributables

By default the control is configured to point the location of the iuembed.js, ImageUploader5.cab, ImageUploader5.jar to the current page folder. You have two options:
1. Copy these files to the starting page folder.
2. Specify alternative paths for ScriptsDir property of the control.

UserPostedImage

Step 6. Add server-side event handlers

By this time, the control has one server-side event . Select Events tab from the Properties pane and double-click the FileUploaded list item. This event is called for each uploaded file (both source file and thumbnails).

Previously you had to write screens of code to process uploaded files. Now you have to write an event handler where you save your files and that's all. To have this ability Action property value should be set to "." to make Image Uploader upload files to the same page.

UserPostedImage

Code:

private string galleryPath = "./Gallery/";

protected void ImageUploader1_FileUploaded(object sender, Aurigma.ImageUploader.FileUploadEventArgs e)

{
	string fileName = GetSafeFileName(Path.GetFileName(e.File.FileName));
	e.File.SaveAs(Server.MapPath(galleryPath + fileName));
}

private string GetSafeFileName(string fileName)
{
	string newFileName = fileName;
	int j = 1;
	while (File.Exists(Server.MapPath(galleryPath + newFileName)))
	{
		newFileName = j + "_" + fileName;
		j++;
	}
        return newFileName;
}


Step 7. Run it

OK. Now it's time to see the results! Press Ctrl+F5 and your default web browser with Image uploader will appear. Upload files and look for them in your gallery folder.

UserPostedImage

Conclusion

The things became simpler. We have spent about five minutes to make a successful result: Image Uploader is configured, files are uploaded.

As you can see if you create ASP.NET applications this control is quite helpful:

1. Native development process. Now you can make Image Uploader pages in more natural way. Just drop a control to the page and configure its properties.
2. Simple property setting. Most non-string properties (enumerations, color values) could be now set from the drop-down list or dialog. In future versions editors for XXXImageFormat, FileMask and other complex properties will be added.
3. Fast server-side script creation. With the help of FileUploaded event you are able to concentrate on what to do with files and not on how to get them from the upload request.
4. No more file hell. The page with Image Uploader and upload processing script are in the same file now, so you don't have to care about not losing your upload processing script.

You can post here all your thoughts about this control, its functionality and usage results and ideas about similar projects you would like to see next.

Edited by moderator Wednesday, February 12, 2014 12:20:14 AM(UTC)  | Reason: Not specified

Sincerely yours,
Alex Makhov

UserPostedImage Follow Aurigma on Twitter!
Fedor  
#2 Posted : Friday, February 8, 2008 4:14:36 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)
I have just updated the project (both sources and binaries).

Change List

1. Added toolbar icons.
2. Implemented support of ASP.NET-syntax relative paths started with "~/".
3. Marked up with [Description] attribute all properties and events.
4. Implemented extended support of XXXImageFromat properties editing.

Best regards,
Fedor Skvortsov
toga  
#3 Posted : Tuesday, March 18, 2008 9:13:43 AM(UTC)
toga

Rank: Newbie

Groups: Member
Joined: 3/18/2008(UTC)
Posts: 2

How would I use the addcookie workaround for authentication request with this control?
Fedor  
#4 Posted : Wednesday, March 19, 2008 8:35:14 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)
toga wrote:
How would I use the addcookie workaround for authentication request with this control?


You can set cookies BeforeUpload event handler:

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<%@ Register Assembly="Aurigma.ImageUploader" Namespace="Aurigma.ImageUploader" TagPrefix="cc1" %>

<!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>

    <script type="text/javascript">
function ImageUploader1_BeforeUpload(){
getImageUploader("<%=ImageUploader1.ClientID%>").AddCookie('<%=FormsAuthentication.FormsCookieName %>=<%= Request.Cookies[FormsAuthentication.FormsCookieName].Value %>');
}
    </script>

</head>
<body>       
    <form id="form1" runat="server">
    <div>
    <cc1:ImageUploader ID="ImageUploader1" runat="server" Height="350px" Width="630px" OnFileUploaded="ImageUploader1_FileUploaded" ShowDebugWindow="True" BeforeUpload="ImageUploader1_BeforeUpload"/>
    </div>
    </form>
</body>
</html>


Actually I think we need to add the automatic cookie handling logic into ASP.NET control.

Edited by user Wednesday, February 12, 2014 12:19:08 AM(UTC)  | Reason: Not specified

Best regards,
Fedor Skvortsov
toga  
#5 Posted : Saturday, March 22, 2008 4:19:44 AM(UTC)
toga

Rank: Newbie

Groups: Member
Joined: 3/18/2008(UTC)
Posts: 2

Good IDEA...!
Mohan  
#6 Posted : Sunday, March 23, 2008 4:08:11 PM(UTC)
Mohan

Rank: Newbie

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

I have used the same way that u have mentioned here, It is working fine in IE 7, but again it gives error in Firefox "Server Redirection Error".
Fedor  
#7 Posted : Monday, March 24, 2008 4:50: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)
Mohan wrote:
I have used the same way that u have mentioned here, It is working fine in IE 7, but again it gives error in Firefox "Server Redirection Error".


Please download the last version of ASP.NET control. It can be found in the top of the page in the end of first post. There was mistake in ASP.NET control event handler implementation, that is why ImageUploader1_BeforeUpload event was never been called.
Best regards,
Fedor Skvortsov
samuelvi  
#8 Posted : Friday, March 28, 2008 1:10:08 AM(UTC)
samuelvi

Rank: Newbie

Groups: Member
Joined: 3/28/2008(UTC)
Posts: 1

Hi,
I have a WebForm in asp.net with a user control (two listboxes and 2 buttons inside an updatepanel) and the Aurigma DLL Control.
When I click on a button inside my own control, the aurigma control dissapears.
Do you know it this issue is due to asp.net ajax library or aurigma dll?
Thanks a lot!
Fedor  
#9 Posted : Monday, March 31, 2008 1:06:13 AM(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)
Samuel,

Please post the entire code you use.
Best regards,
Fedor Skvortsov
wohlstand  
#10 Posted : Wednesday, June 18, 2008 9:21:35 AM(UTC)
wohlstand

Rank: Newbie

Groups: Member
Joined: 5/29/2008(UTC)
Posts: 3

Hi,
I use VS 2008, .net 3.5 and your image uploader server-control. How I can read the image description in the _FileUploaded_event. My Proposal: extend the file-properties.
Second Problem: all variables which I set in the page_init event are empty when I try to read them in the FileUploaded_event. How can I solve this problem.
Thank you for your help.
Fedor  
#11 Posted : Tuesday, June 24, 2008 8:09:57 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)
I am sorry for delay.

Quote:
I use VS 2008, .net 3.5 and your image uploader server-control. How I can read the image description in the _FileUploaded_event. My Proposal: extend the file-properties.
Second Problem: all variables which I set in the page_init event are empty when I try to read them in the FileUploaded_event. How can I solve this problem.


thank you for your feedback. I don't see the elegant way to get file description from FileUploaded event. To resolve the problem I will post the updated control in the nearest time.

Edited by user Tuesday, June 24, 2008 8:10:52 PM(UTC)  | Reason: Not specified

Best regards,
Fedor Skvortsov
pustefisk  
#12 Posted : Wednesday, July 2, 2008 2:07:03 AM(UTC)
pustefisk

Rank: Newbie

Groups: Member
Joined: 4/14/2008(UTC)
Posts: 6

Does anybody know how to add the title & description textboxes.
The 'old' versions had this option to add a title textbox on top of a description textbox to the right of the thumbnail image ?
I don't see options to set this with the asp.net version!
Andrew  
#13 Posted : Wednesday, July 2, 2008 4:51:01 PM(UTC)
Andrew

Rank: Advanced Member

Groups: Member, Administration
Joined: 8/2/2003(UTC)
Posts: 876

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
I suppose you mean Multiple Description demo. In that demo upload pane was generated in JavaScript, it is not a part of Image Uploader.

Currently ASP.NET control wraps Image Uploader only, without any additional HTML/JavaScript parts. But perhaps it is interesting idea to extend this control with additional HTML/JavaScript elements like custom upload pane, etc. What you think guys?
davidous  
#14 Posted : Friday, July 4, 2008 7:08:03 PM(UTC)
davidous

Rank: Newbie

Groups: Member
Joined: 7/4/2008(UTC)
Posts: 2

jepps i agree! i am using do dreamweaver but can't get any image uploader sett up on dreamweaver does any one know how to sett up an uploader on dreamweaver
davidous  
#15 Posted : Saturday, July 5, 2008 6:41:09 AM(UTC)
davidous

Rank: Newbie

Groups: Member
Joined: 7/4/2008(UTC)
Posts: 2

i get error creating control imageupploader1 request is not longer in this context
pustefisk  
#16 Posted : Sunday, July 6, 2008 10:16:49 PM(UTC)
pustefisk

Rank: Newbie

Groups: Member
Joined: 4/14/2008(UTC)
Posts: 6

When running the above example Firefox won't work!

This is what the console shows:

Code:
Load: class com.aurigma.imageuploader.ImageUploader.class not found.

java.lang.ClassNotFoundException: com.aurigma.imageuploader.ImageUploader.class

	at sun.applet.AppletClassLoader.findClass(Unknown Source)

	at java.lang.ClassLoader.loadClass(Unknown Source)

	at sun.applet.AppletClassLoader.loadClass(Unknown Source)

	at java.lang.ClassLoader.loadClass(Unknown Source)

	at sun.applet.AppletClassLoader.loadCode(Unknown Source)

	at sun.appl


The applet area is shown in a gray box with a red cross!
Am I missing some files on the machine or in the project or is this example only intended for MS IExplorer ?
I have included alle the files for the three downloads.


regards

Nicolai Busekist

Edited by moderator Wednesday, February 12, 2014 12:20:41 AM(UTC)  | Reason: Not specified

Fedor  
#17 Posted : Tuesday, July 15, 2008 12:48:13 AM(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)
davidous wrote:
i get error creating control imageupploader1 request is not longer in this context


When have you received this error? In runtime or in design time?
Best regards,
Fedor Skvortsov
Fedor  
#18 Posted : Tuesday, July 15, 2008 12:53:09 AM(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)
pustefisk wrote:
When running the above example Firefox won't work!

This is what the console shows:

Load: class com.aurigma.imageuploader.ImageUploader.class not found.

java.lang.ClassNotFoundException: com.aurigma.imageuploader.ImageUploader.class

at sun.applet.AppletClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadCode(Unknown Source)

at sun.appl

The applet area is shown in a gray box with a red cross!
Am I missing some files on the machine or in the project or is this example only intended for MS IExplorer ?
I have included alle the files for the three downloads.


regards

Nicolai Busekist


Does ScriptsDir property map to folder where ImageUploader5/jar is located?
Best regards,
Fedor Skvortsov
trancehead  
#19 Posted : Thursday, July 17, 2008 1:38:26 AM(UTC)
trancehead

Rank: Newbie

Groups: Member
Joined: 7/17/2008(UTC)
Posts: 4

Does this only work in C#? Using VB.NET it won't fire the event.

Here is my code:

Code:
<Aurigma:ImageUploader ID="imgUpload" runat="server" Height="400px" Width="580px" ShowDebugWindow="True" ScriptsDir="~/Scripts" AllowFolderUpload="false" UploadSourceFile="false"
             EditDescriptionText="add title" RememberLastVisitedFolder="true" OnFileUploaded="imgUpload_FileUploaded" />


Code Behind:

Code:
Protected Sub imgUpload_FileUploaded(ByVal sender As Object, ByVal e As Aurigma.ImageUploader.FileUploadEventArgs) Handles imgUpload.FileUploaded
        MsgBox(e.File.FileName)
    End Sub

Edited by moderator Wednesday, February 12, 2014 12:19:35 AM(UTC)  | Reason: Not specified

Fedor  
#20 Posted : Sunday, July 20, 2008 6:20:16 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)
Quote:
Does this only work in C#? Using VB.NET it won't fire the event.


It should work in VB.NET. I see the following problems in your code:

1. You have attached event handler 2 times:

OnFileUploaded="imgUpload_FileUploaded"

and

Handles imgUpload.FileUploaded

Thus imgUpload_FileUploaded event handler will be called 2 times.

2. I see you use Windows Forms function:

MsgBox(e.File.FileName)

I don't think it should work in Web application.
Best regards,
Fedor Skvortsov
Users browsing this topic
Similar Topics
HELP!! About the System Requirements of Image Uploader ASP.NET Control (Discussions – ActiveX/Java Uploader)
by gostop 12/27/2009 11:41:12 AM(UTC)
PRB: Image Uploader ASP.NET Control throws exception "Request for the permission failed" (FAQ – ActiveX/Java Uploader)
by Tamila 11/19/2009 4:03:59 AM(UTC)
Image Uploader ASP.NET Control and StyleSheet (Image Uploader)
by pustefisk 8/2/2008 7:47:14 PM(UTC)
Image Uploader ASP.NET Control (Discussions – ActiveX/Java Uploader)
by stewsterl 2/27/2008 3:17:53 AM(UTC)
[ANSWERED] Image Uploader ASP.NET Control <BUG> (Discussions – ActiveX/Java Uploader)
by stewsterl 2/4/2008 3:05:29 AM(UTC)
Image Uploader ASP.NET Control (Discussions – ActiveX/Java Uploader)
by Alex Makhov 1/22/2008 7:23:46 PM(UTC)
3 Pages123>
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.