Home All Groups Group Topic Archive Search About

File upload to website and rezise at the same time

Author
25 Jan 2006 3:12 PM
William LaMartin
I have a VB ASP.Net application where the user can upload a file using the
FileUpload server control.  I also want a thumbnail to be created for this
file. Unfortunately I can see no means to determine when the file upload is
complete so that I can use the MakeThumbnail function as part of the code.
My current workaround is to supply an addition button the users can click on
when they think the upload is done that will find the uploaded file and make
the thumbnail.

Is there a way to determine when the upload is complete?

Author
25 Jan 2006 4:11 PM
Patrice
You shouldn't have to worry about this. I believe you have some kind of
problem making you think that the file is not uploaded yet but this is
likely not the problem you have...

What have you seen exactly ?

--
Patrice

Show quoteHide quote
"William LaMartin" <lamar***@tampabay.rr.com> a écrit dans le message de
news:eAEjIHcIGHA.208@tk2msftngp13.phx.gbl...
> I have a VB ASP.Net application where the user can upload a file using the
> FileUpload server control.  I also want a thumbnail to be created for this
> file. Unfortunately I can see no means to determine when the file upload
is
> complete so that I can use the MakeThumbnail function as part of the code.
> My current workaround is to supply an addition button the users can click
on
> when they think the upload is done that will find the uploaded file and
make
> the thumbnail.
>
> Is there a way to determine when the upload is complete?
>
>
>
Author
25 Jan 2006 5:27 PM
William LaMartin
The file gets uploaded.  I just can't immediately follow the upload code
with a make
Thumbnail function since apparently the uploaded file is either not fully
loaded or listed in the file structure of the server at that time.

I think I have solved the problem, though, by adding the following code
right after the upload code.

Dim fi As New System.IO.FileInfo(Server.MapPath(".") & "\Photos\" &
FileUpload1.FileName)
            Do While fi.Exists = False
                'do nothing
            Loop


Show quoteHide quote
"Patrice" <a@bc.c> wrote in message
news:OvPDyscIGHA.3144@TK2MSFTNGP11.phx.gbl...
> You shouldn't have to worry about this. I believe you have some kind of
> problem making you think that the file is not uploaded yet but this is
> likely not the problem you have...
>
> What have you seen exactly ?
>
> --
> Patrice
>
> "William LaMartin" <lamar***@tampabay.rr.com> a écrit dans le message de
> news:eAEjIHcIGHA.208@tk2msftngp13.phx.gbl...
>> I have a VB ASP.Net application where the user can upload a file using
>> the
>> FileUpload server control.  I also want a thumbnail to be created for
>> this
>> file. Unfortunately I can see no means to determine when the file upload
> is
>> complete so that I can use the MakeThumbnail function as part of the
>> code.
>> My current workaround is to supply an addition button the users can click
> on
>> when they think the upload is done that will find the uploaded file and
> make
>> the thumbnail.
>>
>> Is there a way to determine when the upload is complete?
>>
>>
>>
>
>
Author
25 Jan 2006 5:47 PM
Patrice
Still don't know what you have seen exactly. An antivirus software could
also perhaps lock the file for a short period.

IMO this is not something normal. Though it works I would still investigate
a bit further...

--
Patrice

Show quoteHide quote
"William LaMartin" <lamar***@tampabay.rr.com> a écrit dans le message de
news:eiForUdIGHA.3000@TK2MSFTNGP14.phx.gbl...
> The file gets uploaded.  I just can't immediately follow the upload code
> with a make
> Thumbnail function since apparently the uploaded file is either not fully
> loaded or listed in the file structure of the server at that time.
>
> I think I have solved the problem, though, by adding the following code
> right after the upload code.
>
> Dim fi As New System.IO.FileInfo(Server.MapPath(".") & "\Photos\" &
> FileUpload1.FileName)
>             Do While fi.Exists = False
>                 'do nothing
>             Loop
>
>
> "Patrice" <a@bc.c> wrote in message
> news:OvPDyscIGHA.3144@TK2MSFTNGP11.phx.gbl...
> > You shouldn't have to worry about this. I believe you have some kind of
> > problem making you think that the file is not uploaded yet but this is
> > likely not the problem you have...
> >
> > What have you seen exactly ?
> >
> > --
> > Patrice
> >
> > "William LaMartin" <lamar***@tampabay.rr.com> a écrit dans le message de
> > news:eAEjIHcIGHA.208@tk2msftngp13.phx.gbl...
> >> I have a VB ASP.Net application where the user can upload a file using
> >> the
> >> FileUpload server control.  I also want a thumbnail to be created for
> >> this
> >> file. Unfortunately I can see no means to determine when the file
upload
> > is
> >> complete so that I can use the MakeThumbnail function as part of the
> >> code.
> >> My current workaround is to supply an addition button the users can
click
> > on
> >> when they think the upload is done that will find the uploaded file and
> > make
> >> the thumbnail.
> >>
> >> Is there a way to determine when the upload is complete?
> >>
> >>
> >>
> >
> >
>
>
Author
25 Jan 2006 9:58 PM
William LaMartin
It appears to me that VB does not wait for the FileUpload server control to
finish saving the file to the server hard drive before proceeding to execute
the next line of code.  And if that next line of code requires access to the
uploaded file you run into trouble--unless you wait until you know that the
file exists, which is why checking for its existence before proceeding
appears to solve the problem.


Show quoteHide quote
"Patrice" <a@bc.c> wrote in message
news:eDcd0ddIGHA.3936@TK2MSFTNGP10.phx.gbl...
> Still don't know what you have seen exactly. An antivirus software could
> also perhaps lock the file for a short period.
>
> IMO this is not something normal. Though it works I would still
> investigate
> a bit further...
>
> --
> Patrice
>
> "William LaMartin" <lamar***@tampabay.rr.com> a écrit dans le message de
> news:eiForUdIGHA.3000@TK2MSFTNGP14.phx.gbl...
>> The file gets uploaded.  I just can't immediately follow the upload code
>> with a make
>> Thumbnail function since apparently the uploaded file is either not fully
>> loaded or listed in the file structure of the server at that time.
>>
>> I think I have solved the problem, though, by adding the following code
>> right after the upload code.
>>
>> Dim fi As New System.IO.FileInfo(Server.MapPath(".") & "\Photos\" &
>> FileUpload1.FileName)
>>             Do While fi.Exists = False
>>                 'do nothing
>>             Loop
>>
>>
>> "Patrice" <a@bc.c> wrote in message
>> news:OvPDyscIGHA.3144@TK2MSFTNGP11.phx.gbl...
>> > You shouldn't have to worry about this. I believe you have some kind of
>> > problem making you think that the file is not uploaded yet but this is
>> > likely not the problem you have...
>> >
>> > What have you seen exactly ?
>> >
>> > --
>> > Patrice
>> >
>> > "William LaMartin" <lamar***@tampabay.rr.com> a écrit dans le message
>> > de
>> > news:eAEjIHcIGHA.208@tk2msftngp13.phx.gbl...
>> >> I have a VB ASP.Net application where the user can upload a file using
>> >> the
>> >> FileUpload server control.  I also want a thumbnail to be created for
>> >> this
>> >> file. Unfortunately I can see no means to determine when the file
> upload
>> > is
>> >> complete so that I can use the MakeThumbnail function as part of the
>> >> code.
>> >> My current workaround is to supply an addition button the users can
> click
>> > on
>> >> when they think the upload is done that will find the uploaded file
>> >> and
>> > make
>> >> the thumbnail.
>> >>
>> >> Is there a way to determine when the upload is complete?
>> >>
>> >>
>> >>
>> >
>> >
>>
>>
>
>
Author
26 Jan 2006 8:24 AM
Patrice
I still don't know what was the message you had and I would have been
interested in seeing some code. Execution is supposed to be sequential.
I'll give this a try as soon as I have 2.0 handy.

--
Patrice

Show quoteHide quote
"William LaMartin" <lamar***@tampabay.rr.com> a écrit dans le message de
news:uXojO3fIGHA.140@TK2MSFTNGP12.phx.gbl...
> It appears to me that VB does not wait for the FileUpload server control
to
> finish saving the file to the server hard drive before proceeding to
execute
> the next line of code.  And if that next line of code requires access to
the
> uploaded file you run into trouble--unless you wait until you know that
the
> file exists, which is why checking for its existence before proceeding
> appears to solve the problem.
>
>
> "Patrice" <a@bc.c> wrote in message
> news:eDcd0ddIGHA.3936@TK2MSFTNGP10.phx.gbl...
> > Still don't know what you have seen exactly. An antivirus software could
> > also perhaps lock the file for a short period.
> >
> > IMO this is not something normal. Though it works I would still
> > investigate
> > a bit further...
> >
> > --
> > Patrice
> >
> > "William LaMartin" <lamar***@tampabay.rr.com> a écrit dans le message de
> > news:eiForUdIGHA.3000@TK2MSFTNGP14.phx.gbl...
> >> The file gets uploaded.  I just can't immediately follow the upload
code
> >> with a make
> >> Thumbnail function since apparently the uploaded file is either not
fully
> >> loaded or listed in the file structure of the server at that time.
> >>
> >> I think I have solved the problem, though, by adding the following code
> >> right after the upload code.
> >>
> >> Dim fi As New System.IO.FileInfo(Server.MapPath(".") & "\Photos\" &
> >> FileUpload1.FileName)
> >>             Do While fi.Exists = False
> >>                 'do nothing
> >>             Loop
> >>
> >>
> >> "Patrice" <a@bc.c> wrote in message
> >> news:OvPDyscIGHA.3144@TK2MSFTNGP11.phx.gbl...
> >> > You shouldn't have to worry about this. I believe you have some kind
of
> >> > problem making you think that the file is not uploaded yet but this
is
> >> > likely not the problem you have...
> >> >
> >> > What have you seen exactly ?
> >> >
> >> > --
> >> > Patrice
> >> >
> >> > "William LaMartin" <lamar***@tampabay.rr.com> a écrit dans le message
> >> > de
> >> > news:eAEjIHcIGHA.208@tk2msftngp13.phx.gbl...
> >> >> I have a VB ASP.Net application where the user can upload a file
using
> >> >> the
> >> >> FileUpload server control.  I also want a thumbnail to be created
for
> >> >> this
> >> >> file. Unfortunately I can see no means to determine when the file
> > upload
> >> > is
> >> >> complete so that I can use the MakeThumbnail function as part of the
> >> >> code.
> >> >> My current workaround is to supply an addition button the users can
> > click
> >> > on
> >> >> when they think the upload is done that will find the uploaded file
> >> >> and
> >> > make
> >> >> the thumbnail.
> >> >>
> >> >> Is there a way to determine when the upload is complete?
> >> >>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >>
> >
> >
>
>