Ask a Question related to ASP.NET General, Design and Development.
-
Bill Priess #1
Re: Upload file problem with postback
You can use the CustomValidatior to do client-side validation before
postback. As for the File upload control... even when run server-side, it
does not participate in ViewState, so whenever a postback occurs, the field
is cleared. You could possibly roll your own UserControl to participate in
ViewState and repopulate it that way, but HTMLControls are not recommended
to be use in UserControls.
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-[/url]
us/speechcontrols/html/sc_customvalidator.asp
HTH,
Bill P.
On 5 Aug 2003 08:04:08 -0700, john <j.w.horlock@leeds.ac.uk> wrote:
> Hi
> At present i have an upload form which allows users to select a file
> which they want to upload and then enter data in to a form to add
> extra value to the file.
> When the form is submitted, the form is checked to see that all the
> required bnoxes have been filled in and the file type is acceptable.
> If this is all ok it works fine, but if it stops due to a required
> filed not been filled in the form is returned to the user for them to
> complete it.....
> BUT.... the browse box where the file was selected is now emtyp due to
> the postback.
>
> Is there anyway to call my 'validate' function with out having the
> form submitted or HOW to save the file from the client to my server
> without using posetedfile.inputbox.saveAS(..............)
>
> My current button code is <asp:button ID="insertButton" Text="Insert
> Form" OnClick="Validate"
> runat="server" />
>
>
> many thanks
>
> John.
>
--
Using M2, Opera's revolutionary e-mail client: [url]http://www.opera.com/m2/[/url]
Bill Priess Guest
-
file upload problem
Hi, I think that the methos should be POST not GET Second, you may want to save the file first with, move_uploaded_file (see... -
File upload and page PostBack.
In my project I am uploading file using File control. After browsing file user needs to select other values from DropdownList to determine... -
File Upload Problem - nothing in /tmp
My PHP.ini file sets the following: file_uploads = on upload_max_filesize = 3M upload_tmp_dir = /tmp When I try and upload the file, it... -
[PHP] file upload problem
when you are uploading files via a form, you must use the POST method. Jim Lucas ----- Original Message ----- From: "Matthias Wulkow"... -
PHP file upload problem
Hi all, Heres a strange problem i am running into running Php4.2.2. I am uploading a file using a post and when i receive the file on my share... -
Kevin Spencer #2
Re: Upload file problem with postback
Use client-side JavaScript form validation. Example:
<script type="text/javascript"><!--
function validate()
{
if (document.forms[0].LastName.Value == "") {
alert("You must supply a value for 'Last Name'");
return (false);
}
// other tests - return false if invalid
return (true);
}
// --></script>
<form runat="server" onsubmit="return validate()">
....
</form>
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
[url]http://www.takempis.com[/url]
Complex things are made up of
lots of simple things.
"john" <j.w.horlock@leeds.ac.uk> wrote in message
news:8456800a.0308050704.261831ae@posting.google.c om...> Hi
> At present i have an upload form which allows users to select a file
> which they want to upload and then enter data in to a form to add
> extra value to the file.
> When the form is submitted, the form is checked to see that all the
> required bnoxes have been filled in and the file type is acceptable.
> If this is all ok it works fine, but if it stops due to a required
> filed not been filled in the form is returned to the user for them to
> complete it.....
> BUT.... the browse box where the file was selected is now emtyp due to
> the postback.
>
> Is there anyway to call my 'validate' function with out having the
> form submitted or HOW to save the file from the client to my server
> without using posetedfile.inputbox.saveAS(..............)
>
> My current button code is
> <asp:button ID="insertButton" Text="Insert Form" OnClick="Validate"
> runat="server" />
>
>
> many thanks
>
> John.
Kevin Spencer Guest
-
john horlock #3
Re: Upload file problem with postback
Hi
Cheers for the advice.
I think for now i will do the form validation in javascript.
Although i'm still curious to find out about different ways of uploading
files with out using the postedfile.SaveAs method.
Cheers
John
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
john horlock Guest



Reply With Quote

