Ajax File Uploader

Discussion in 'ASP .Net' started by Author #1, Aug 27, 2009.

  1. Author #1

    Author #1 Guest

    My asp.net 3.5 web application needs to upload many user documents to
    the SQL Server database. I don't quite like the asp.net native
    FileUpload control, so I searched a little on the web and found one at

    http://en.fileuploadajax.subgurim.net/

    It is pretty good in that it is free and works like the gmail
    attachment uploader.

    The only problem I have with this control is this:

    If I pass some variables and their values from Page1.aspx through the
    query string to Page2.aspx which uses this control, I won't be able to
    retrieve these variables from the query string. I also tried passing
    these variables through the Context collection, it still doesn't
    work. It'll work if I pass these values through session or if I store
    them in the SQL Server database and retrieve them in Page2.aspx.

    Somehow the query string or the Context collection isn't available to
    the iframe of the this file upload control, thus when the file upload
    causes a postback, I receive an exception.

    I don't quite like the session or db solution to this problem, because
    the session variable will be available to all pages while the session
    is valid. And for the db solution, I will have to clean up the stored
    variables in the db when the session times out or when a user logs
    out. A lot of trouble.

    Any suggestion for a good ajax file uploader? Thanks.
    Author #1, Aug 27, 2009
    #1
    1. Advertising

  2. Author #1

    Patrice Guest

    Hello,

    > If I pass some variables and their values from Page1.aspx through the
    > query string to Page2.aspx which uses this control, I won't be able to
    > retrieve these variables from the query string.
    > Somehow the query string or the Context collection isn't available to
    > the iframe of the this file upload control, thus when the file upload
    > causes a postback, I receive an exception.


    An iframe is just a kind of browser side "placeholder" that shows the
    content of a page inside a page. My guess is that you pass those values as a
    querystring to the page that contains the iframe tag but not to the url used
    by the iframe tag itself. It shoudl work if you do so...

    --
    Patrice
    Patrice, Aug 27, 2009
    #2
    1. Advertising

  3. Author #1

    Author #1 Guest

    On Aug 27, 5:07 pm, "Patrice" <http://scribe-en.blogspot.com/> wrote:
    > Hello,
    >
    > > If I pass some variables and their values from Page1.aspx through the
    > > query string to Page2.aspx which uses this control, I won't be able to
    > > retrieve these variables from the query string.
    > > Somehow the query string or the Context collection isn't available to
    > > the iframe of the this file upload control, thus when the file upload
    > > causes a postback, I receive an exception.

    >
    > An iframe is just a kind of browser side "placeholder" that shows the
    > content of a page inside a page. My guess is that you pass those values as a
    > querystring to the page that contains the iframe tag but not to the url used
    > by the iframe tag itself. It shoudl work if you do so...
    >
    > --
    > Patrice


    Thanks for the hint. If there is a iframe, it is built into the ajax
    file upload control, I have no idea how it works and what URL it may
    get.
    Author #1, Aug 28, 2009
    #3
  4. Author #1

    Patrice Guest

    >> Thanks for the hint. If there is a iframe, it is built into the ajax
    >> file upload control, I have no idea how it works and what URL it may
    >> get.


    I gave a quick look and it seems to create and use programmatically an
    iframe. The first question would be where/how do you try to read the
    querystring ? If this is in the usual page2.aspx lifecycle it should work as
    you likely passed correctly the values. If this is in an AJAX related call
    it is likely that the control doesn't pass those automatically and it would
    explain why you can't read them. You could start by checking the request to
    first see if the needed values are passed or not (whihc is likely) on the
    querystring. Then you'll have to fix the problem (whihc may be more or less
    complex especially if the source is not provided).

    Good luck.

    --
    Patrice
    Patrice, Aug 28, 2009
    #4
  5. Author #1

    Author #1 Guest

    On Aug 28, 7:57 am, "Patrice" <http://scribe-en.blogspot.com/> wrote:
    > >> Thanks for the hint.  If there is a iframe, it is built into the ajax
    > >> file upload control, I have no idea how it works and what URL it may
    > >> get.

    >
    > I gave a quick look and it seems to create and use programmatically an
    > iframe. The first question would be where/how do you try to read the
    > querystring ? If this is in the usual page2.aspx lifecycle it should work as
    > you likely passed correctly the values. If this is in an AJAX related call
    > it is likely that the control doesn't pass those automatically and it would
    > explain why you can't read them. You could start by checking the request to
    > first see if the needed values are passed or not (whihc is likely) on the
    > querystring. Then you'll have to fix the problem (whihc may be more or less
    > complex especially if the source is not provided).
    >
    > Good luck.
    >
    > --
    > Patrice


    The control has to be wrapped up in an UpdatePanel. I have no problem
    working with the query string parameters if I simply remove this
    control from the web form. This control will cause a double postback.
    The first time, the web form does a postback, then (I guess) the
    iframe of this control causes a postback. During the first postback,
    I can retrieve the query string parameters and their values, but
    cannot in the second postback. I notice this when I was using the
    debugger.
    Author #1, Aug 28, 2009
    #5
  6. Author #1

    Patrice Guest

    At this step you should likely provide the shortest possible sample that
    shows this problem all along with the overall goal (you won't to puload a
    file without refreshing the whole page ?) so that we can better understanbd,
    repro the problem and possibly solve it.

    For now I would say that you are confusing plain regular postback and out of
    band AJAX based postback who likely won't provide the querystring
    information ? Also the goal of this third party control seems to avoid a
    refresh so I'm not sure why you have to put this in an update panel.

    Sorry for the poor help.

    --
    Patrice
    Patrice, Aug 29, 2009
    #6
  7. Author #1

    Author #1 Guest

    On Aug 29, 7:22 am, "Patrice" <http://scribe-en.blogspot.com/> wrote:
    > At this step you should likely provide the shortest possible sample that
    > shows this problem all along with the overall goal (you won't to puload a
    > file without refreshing the whole page ?) so that we can better understanbd,
    > repro the problem and possibly solve it.
    >
    > For now I would say that you are confusing plain regular postback and out of
    > band AJAX based postback who likely won't provide the querystring
    > information ? Also the goal of this third party control seems to avoid a
    > refresh so I'm not sure why you have to put this in an update panel.
    >
    > Sorry for the poor help.
    >
    > --
    > Patrice


    Hi, thank you for the hint. I create a small website to test this
    control, and it doesn't have problem with my query string variables.
    I guess it is something else on my web form that's causing this
    problem. I will do some further analysis and see what exactly is
    going on.
    Author #1, Aug 30, 2009
    #7
  8. Author #1

    Martin M Guest

    XUploader may help, could find it from www.springsys.com


    -m


    > My asp.net 3.5 web application needs to upload many user documents to
    > the SQL Server database. I don't quite like the asp.net native
    > FileUpload control, so I searched a little on the web and found one at
    >
    > http://en.fileuploadajax.subgurim.net/
    >
    > It is pretty good in that it is free and works like the gmail
    > attachment uploader.
    >
    > The only problem I have with this control is this:
    >
    > If I pass some variables and their values from Page1.aspx through the
    > query string to Page2.aspx which uses this control, I won't be able to
    > retrieve these variables from the query string. I also tried passing
    > these variables through the Context collection, it still doesn't
    > work. It'll work if I pass these values through session or if I store
    > them in the SQL Server database and retrieve them in Page2.aspx.
    >
    > Somehow the query string or the Context collection isn't available to
    > the iframe of the this file upload control, thus when the file upload
    > causes a postback, I receive an exception.
    >
    > I don't quite like the session or db solution to this problem, because
    > the session variable will be available to all pages while the session
    > is valid. And for the db solution, I will have to clean up the stored
    > variables in the db when the session times out or when a user logs
    > out. A lot of trouble.
    >
    > Any suggestion for a good ajax file uploader? Thanks.
    Martin M, Oct 5, 2009
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andy

    HTML File Uploader

    Andy, Dec 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    409
  2. Gefster
    Replies:
    1
    Views:
    449
    Chris Bailey
    Jun 18, 2004
  3. BORG

    Picture uploader

    BORG, Jun 25, 2003, in forum: HTML
    Replies:
    1
    Views:
    2,213
    David Dorward
    Jun 25, 2003
  4. ll

    file uploader script

    ll, Oct 10, 2007, in forum: Perl Misc
    Replies:
    4
    Views:
    123
  5. groupie

    Multiple file uploader

    groupie, Jan 28, 2008, in forum: Javascript
    Replies:
    0
    Views:
    76
    groupie
    Jan 28, 2008
Loading...

Share This Page