By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,370 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,370 IT Pros & Developers. It's quick & easy.

File upload to website and rezise at the same time

P: n/a
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?

Jan 25 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
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" <la******@tampabay.rr.com> a écrit dans le message de
news:eA*************@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?

Jan 25 '06 #2

P: n/a
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:Ov**************@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" <la******@tampabay.rr.com> a écrit dans le message de
news:eA*************@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?


Jan 25 '06 #3

P: n/a
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" <la******@tampabay.rr.com> a écrit dans le message de
news:ei**************@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:Ov**************@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" <la******@tampabay.rr.com> a écrit dans le message de
news:eA*************@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?



Jan 25 '06 #4

P: n/a
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:eD**************@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" <la******@tampabay.rr.com> a écrit dans le message de
news:ei**************@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:Ov**************@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" <la******@tampabay.rr.com> a écrit dans le message
> de
> news:eA*************@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?
>>
>>
>>
>
>



Jan 25 '06 #5

P: n/a
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

"William LaMartin" <la******@tampabay.rr.com> a écrit dans le message de
news:uX*************@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:eD**************@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" <la******@tampabay.rr.com> a écrit dans le message de
news:ei**************@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:Ov**************@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" <la******@tampabay.rr.com> a écrit dans le message
> de
> news:eA*************@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?
>>
>>
>>
>
>



Jan 26 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.