PDA

View Full Version : Persits ASP Upload problem


dominicall
04-05-2003, 12:45 PM
Am using Persits ASP Upload for uploading two image from a form. Images are saved to directory in the site with image names and some other form field info saved to database.

I do an error check on the form before finally commiting data to the database and if there are errors sned them back to the form with the errors highlighted.

The problem only occurs if I then try and re-submit the form - I get the following IIS error - whether or not there were any errors in the form.
Persits.Upload.1 error '800a0005'
The data area passed to a system call is too small.

/admin/includes/boats/add1.asp, line 10

I've attached the form/script zipped up.

I think it may be a problem with my test server set-up rather than the script itself - but am not sure.

Anyone any ideas???

Tx

dominicall :confused:

Morgoth
04-05-2003, 08:26 PM
Ok, so this is what I understand.

When the page loads, and you submit the information and if there is no error, it works fine?

Now, if there is an error, it will tell you?

Now when you submit it again, that's when you get the Persits.Upload.1 error '800a0005'?

Is this all true?
If it's not please explain the problem again exactly how it gets to that error.

dominicall
04-06-2003, 08:17 PM
Yep - that's exactly the process - and put much more succinctly than I described it.

LOL

dominicall

Morgoth
04-06-2003, 09:13 PM
I am looking over the code now, but!
I said:
Now when you submit it again, that's when you get the Persits.Upload.1 error '800a0005'?

This is the second time submiting after the error.
Now, does the error come up when there is a problem with the submition Or does the error come up when the submition is fine Or does the error come up with both (not matter what, the second submition gives you this error)?

Understand?

dominicall
04-07-2003, 07:37 PM
OK - the server error message occurs if I try and submit after there has been a user error in completion of the form.

On first submission of the form, if everything in the form is OK then the whole thing works fine (and I'm happy :D)

However, if there are errors in the first submission of the form, then I report the errors, highlight the fields in error on the form and invire user to re-complete the form and re-submit.

It's in the re-submission that the server error occurs - irrespective of whether the actual contents of the form are OK or not.

The process should be:

1. Complete the form (text fields and file fields)
2. Check for errors server side empty values, invalid entries and wrong files types/sizes
3a. If no errors, submit data, or

3b. If errors, report errors and highlight fields in form
4. Re-submit form
5. Error-check form
6. etc..... (you get it??)

If we get to 3a (i.e. no errors in first submission of the form) then I'm happy.

But if we end up at 3b, it doesn't matter if the subsequent submission is OK or not - it throws the error...

Very frustrating...

dominicall

Morgoth
04-07-2003, 11:28 PM
Then it's a problem with to causes.
The form has been edited, and it's not sending the data properly because of it...
Or, there is a memory error of some sort. It's sending data but it doesn't get saved in the memory, and therfore, a field with should be filled, is not, but it thinks it is. Possible a DataType problem. Cint() Cstr() will be used at that point.

I will look through the code, but if I don't see it, I want you to do yourself a favour and see if it works when you do this:

Copy this page, and save it as a backup.
Then, I want you to open up the page as if the form was never submited, and I want you to get the source.
Take that source code, (no ASP tags at all) and paste it in place of the form you have with ASP tags. (Minor adjust ments might be required, but make sure it's something really important.)

Do you see what I am getting at?

Now that the forms match for both Fresh page, and on error page, you can send the data.. If the page still has errors, then you know what you do.


Now just incase this problem is not solved by that, I suggest something that would be a little more effective. Two pages, one for the form, and one for the uploading. And to send the information back to the form page, for errors that must be fixed, you can use Sessions. But make sure the session cookie is CLEARED at the very end of the form.

Understand?
If not, I will try to explain it better.

dominicall
04-08-2003, 09:06 AM
Had already tried the two page version - same error... am sure it's actually an OS/IIS thing... am going to try doing a save to memory first rather than save to disc straight away and see what happens....

Will let you know...

dominicall

Morgoth
04-08-2003, 04:49 PM
That might do it...
Cause then, when they upload it to memory, you can check everything... If it's not correct, then you send them away from the upload spot. If it is ok, then save.

Hum...
I am still not sure exactly what the problem is though...