Welcome Guest Search | Active Topics

Add Reply New Topic

Image Uploader ASP.NET Control

Options
Dmitry
Posted: Wednesday, January 14, 2009 10:27:32 PM
Dmitry's avatar
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 910
Points: 978
Hello,

Have you specified thumbnail parameters in your aspx page? Could you list the page source here?

Sincerely yours,
Dmitry Sevostyanov.
ansch
Posted: Monday, March 02, 2009 2:29:34 PM
Rank: Newbie
Groups: Member

Joined: 3/2/2009
Posts: 3
Points: 9
Hi,

I have downloaded a trial version of the image uploader as well as this asp.net control. It works fine in my localhost and able to upload files. However, when I did exactly the same installation to our web server it came up with an error "No valid license key for current dns/ip address specified" I have sent a support email and was told to insert the trial license key parameter. I'm not sure where I should insert this since I'm using the asp.net control.

Please advice
Thanks

Anson
Tamila
Posted: Monday, March 02, 2009 9:36:49 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 3/10/2008
Posts: 419
Points: 1,160
Anson,

See my answer in case.


Best regards,
Tamila Ashrafova

Aurigma Support Team
ansch
Posted: Monday, March 02, 2009 9:47:12 PM
Rank: Newbie
Groups: Member

Joined: 3/2/2009
Posts: 3
Points: 9
Thank you for your help Tamila. That worked perfectly :)
ansch
Posted: Monday, March 02, 2009 10:14:44 PM
Rank: Newbie
Groups: Member

Joined: 3/2/2009
Posts: 3
Points: 9
Another question. Is there anyway to use this asp.net control to retrieve the description text entered? There doesn't seem to be a property for it at the moment.
Dmitry
Posted: Monday, March 09, 2009 1:11:07 AM
Dmitry's avatar
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 910
Points: 978
Hello,

The only way to get descriptions is to extract them from POST request fields in the FileUploaded handler. You need to get Description_N fields values (for example, Request.Form["Description_1"]).

Please, read POST Field Reference and Writing Server-Side Upload Code for additional information.

Sincerely yours,
Dmitry Sevostyanov.
gauravr
Posted: Tuesday, March 17, 2009 4:42:15 AM
Rank: Newbie
Groups: Member

Joined: 3/17/2009
Posts: 1
Points: -94
I'm using Visual Studio 2008 and control does not render in the designer. The error shown on the control is:

Error Rendering Control - ImageUploader1
Request is not available in this context.

After that according to ur suggestion given to somebody, i changed the code in onInit method of ImageUploader.cs
from
base.OnInit(e);

            if (Page.Request.Files.Count > 0)
            {
                for (int i = 0; i < Page.Request.Files.Count; i++)


to

      base.OnInit(e);

            if (!DesignMode && Page.Request.Files.Count > 0)
            {
                for (int i = 0; i < Page.Request.Files.Count; i++)


and made a new dll. After consuming the new dll, it's giving same error as mentioned above. Please tell me the solution as soon as possible.



With Best Regards,
gaurav malik

File Attachment(s):
Aurigma.ImageUploader.dll (172kb) downloaded 9 time(s).


Dmitry
Posted: Tuesday, March 17, 2009 11:37:48 PM
Dmitry's avatar
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 910
Points: 978
Hello,

I just modified the code in the same way as you described in your post and it worked great for me in VS2008. I did the following:
  1. Opened ImageUploader.cs and modified OnInit method:
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
    
        if (!DesignMode && Page.Request.Files.Count > 0)
        {
            for (int i = 0; i < Page.Request.Files.Count; i++)
            {
                HttpPostedFile file = Page.Request.Files[i];
    
                FileUploadEventArgs args = new FileUploadEventArgs(file);
    
                OnFileUploaded(args);
            }
    
            HttpContext.Current.Response.End();
        }
    }
  2. Closed my sample project in Visual Studio.
  3. Recompiled Aurigma.ImageUploader.dll and put it into /bin folder of my sample project.
  4. Opened my sample project.
It works okay. Please, find the updated Aurigma.ImageUploader.dll in the attachment.

File Attachment(s):
Aurigma.ImageUploader.dll (162kb) downloaded 17 time(s).




Sincerely yours,
Dmitry Sevostyanov.
MyHuntSite
Posted: Wednesday, March 18, 2009 8:09:55 PM
Rank: Newbie
Groups: Member

Joined: 3/18/2009
Posts: 4
Points: 12
BeforUpload is not working. It's not being called server side.

<cc1:ImageUploader ID="ImageUploader1" BeforeUpload="ImageUploader1_BeforeUpload"  runat="server">
        </cc1:ImageUploader>



Protected Sub ImageUploader1_BeforeUpload(ByVal sender As Object, ByVal e As Aurigma.ImageUploader.FileUploadEventArgs)

End Sub


How would you use ImageUploader1.BeforeUpload ?
Fedor
Posted: Thursday, March 19, 2009 6:15:57 AM
Fedor's avatar
Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,310
Points: -171
Location: WA, US
Hello,

Quote:
BeforUpload is not working. It's not being called server side.

<cc1:ImageUploader ID="ImageUploader1" BeforeUpload="ImageUploader1_BeforeUpload" runat="server">
</cc1:ImageUploader>


Protected Sub ImageUploader1_BeforeUpload(ByVal sender As Object, ByVal e As Aurigma.ImageUploader.FileUploadEventArgs)

End Sub

How would you use ImageUploader1.BeforeUpload ?



Could you post here or submit case with entire page code?

Best regards,
Fedor Skvortsov
MyHuntSite
Posted: Friday, March 20, 2009 5:11:44 PM
Rank: Newbie
Groups: Member

Joined: 3/18/2009
Posts: 4
Points: 12
  <cc1:ImageUploader ID="ImageUploader1" BeforeUpload="ImageUploader1_BeforeUpload" runat="server">
</cc1:ImageUploader>


The JavaScript is called and not server side for ImageUploader1_BeforeUpload.

I added this to the page for a test. The Javascript is being called and not the server side code. I fixed my problem using AJAX but it would be nice if the control would take care of it.

Thanks

<script type="text/javascript">

    function ImageUploader1_BeforeUpload(){
    alert('not on server');
    }
   
    </script>


My code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ImageUploaderError.aspx.vb" Inherits="Members_ImageUploaderError" %>

<%@ 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" BeforeUpload="ImageUploader1_BeforeUpload" runat="server">
</cc1:ImageUploader>

    </div>
    </form>
</body>
</html>



Partial Class Members_ImageUploaderError
    Inherits System.Web.UI.Page

    Protected Sub [b]ImageUploader1_BeforeUpload[/b](ByVal sender As Object, ByVal e As Aurigma.ImageUploader.FileUploadEventArgs)
        Dim tets As String = "DD"
    End Sub

'And I Tried this and other variations
Protected Sub ImageUploader1_BeforeUpload()
        Dim tets As String = "DD"
    End Sub


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        ImageUploader1.ScriptsDir = "ImageUploader"
        ImageUploader1.Width = "700"
        ImageUploader1.Height = "600"

    End Sub
End Class
Fedor
Posted: Sunday, March 22, 2009 8:58:29 AM
Fedor's avatar
Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,310
Points: -171
Location: WA, US
Hello,

I am sorry, I have not paid enough attention to the fact that you use client-side only BeforeUpload event.

There are numerous client-side events, and only one server FileUploaded event.

You try to use client-side event on server side, but it doesn't work due to design.

If you want to handle uploaded files, please use FileUploaded event:

    <cc1:ImageUploader ID="ImageUploader1" runat="server" Height="350px" Width="630px" OnFileUploaded="ImageUploader1_FileUploaded" ShowDebugWindow="True" />


Best regards,
Fedor Skvortsov
nagwa
Posted: Monday, April 06, 2009 11:14:45 PM
Rank: Newbie
Groups: Member

Joined: 4/6/2009
Posts: 1
Points: 3
i've just downloaded the dll and used it in my website. whenever i try to upload an image the control display a message upload complete but i can' find any image in the folder i specified as the gallerypath
this is my code
ASPX page

<Aurigma:ImageUploader ID="ImageUploader" runat="server" Height="500px" Width="700px" ShowDebugWindow="True" ScriptsDir="~/UploadScript" AllowFolderUpload="false" UploadSourceFile="false"
             EditDescriptionText="add title" RememberLastVisitedFolder="true" OnFileUploaded="ImageUploader_FileUploaded" />


VB page
Imports System.IO
Partial Class Autho_UploadImg
    Inherits System.Web.UI.Page

    Private galleryPath As String = "./Gallery/"

    Protected Sub ImageUploader_FileUploaded(ByVal sender As Object, ByVal e As Aurigma.ImageUploader.FileUploadEventArgs)

        Dim fileName As String = GetSafeFileName(Path.GetFileName(e.File.FileName))
        e.File.SaveAs(Server.MapPath(galleryPath + fileName))
    End Sub

    Private Function GetSafeFileName(ByVal fileName As String) As String
        Dim newFileName As String = fileName
        Dim j As Integer = 1
        While File.Exists(Server.MapPath(galleryPath + newFileName))
            newFileName = (j & "_") + fileName
            j += 1
        End While
        Return newFileName
    End Function

End Class
Fedor
Posted: Tuesday, April 07, 2009 10:33:27 AM
Fedor's avatar
Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,310
Points: -171
Location: WA, US
nagwa,

Have you tried to debug your code? Could you post here or submit case with entire page code?

Best regards,
Fedor Skvortsov
ahmed7914
Posted: Wednesday, April 15, 2009 2:39:29 PM
Rank: Newbie
Groups: Member

Joined: 4/15/2009
Posts: 2
Points: 6
Working :-)

Thanks a lot Alex
ahmed7914
Posted: Friday, April 17, 2009 2:51:00 PM
Rank: Newbie
Groups: Member

Joined: 4/15/2009
Posts: 2
Points: 6
Hi,

I have used the same way that u have mentioned here, It is working fine in .Net 2005, but when i tried to use it in .Net 2008, iam getting a an error in design time "Error Creating Control - ImageUploader1 Request is not Valid in this context".

Best Regards,

Ahmed Hussein



Dmitry
Posted: Saturday, April 18, 2009 2:21:47 AM
Dmitry's avatar
Rank: Advanced Member
Groups: Administration , Member

Joined: 8/3/2003
Posts: 910
Points: 978
Hello Ahmed,

Please, read my answer posted on March, 18, 2009 in this thread.

Sincerely yours,
Dmitry Sevostyanov.
Users browsing this topic
Guest

Add Reply New Topic

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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.