Link to home
Start Free TrialLog in
Avatar of chakrika
chakrika

asked on

file upload attachment

Hi,
I've a file upload button in one of my web forms.  I attach any document by clicking the browse in the web form.

then I click on submit which submits the doc . It has the following code

if (confirm('Press OK to Save & Process this request')) {
        document.forms["Content"].submit();
}

I click OK, Now all the stuff is saved successfully. but i do not see the attachment in the bottom when I open the doc in lotus notes or web.

what could be possibly wrong?

thanks
Avatar of p_partha
p_partha

Is there any code in webquerysave removing the attachment. Also check witha new form with just the file upload control and see whether u are able to see the attachment

partha
Avatar of chakrika

ASKER

I checked the code in webquery save agent. its a simple agent that sends email with some values sourced from this form.

I created a simple form, and in the between the <form>   </form> tags i created one File upload control.

still it dosen't work. I click browse and point the file and it puts the path in there.

i click on submit and then later when i open the doc in the view in notes the attachment is not there.

first of all i'm not sure if the attachment is getting posted as well.

WHen you do a submit, what do u give document.forms[0].submit()? if yes then your file upload control may not be in that form tag itself

Try this first of all figure out through view source whetehr your file upload control comes in which form tag and then give the submit appropriately

i.e document.forms[<yourformname>].submit()

partha
if i remove all the html in the form and just have this file load then it is posting the attachment.

otherwise it is not.. something wrong with the post.

no the problem is what is sent back to the server as a result of post operation. You have added your own form tag, and when you submit you might be doing a document.forms[0].submit, this doesn't do a post operation of 'your' form tag and if the file upload control falls on this form tag, then it will not be posted

Hope i am clear

partha
I have the following when I submit.

  if (confirm('Press OK to Save & Process this request'))
     {
       document.forms["MainContent"].submit();
      }  

The file upload control is between the <form>  </form> tags.
is the fileupload control between the form tag Maincontent, if yes then it will be posted along with the other data to the server otherwise no

partha
to be more specific.

the file upload is in between the following code:

<FORM METHOD=POST ACTION="" NAME="MainContent">
<INPUT TYPE=hidden NAME="__Click" VALUE="0">
<BR>

FILE UPLOAD CONTROL IS HERE

submit button is here.
see the view source and see how many form tags are there.. I seriously doubt there iwll be one more form tag in the middle

Partha
there are no other form tags other then these the one for MainContent.

Can u paste the view source if it is not too much

partha
wow.. its real big partha. it won't fit here.
ASKER CERTIFIED SOLUTION
Avatar of p_partha
p_partha

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you just have one HTML form tag in your domino form try the following

document.forms[1].submit()
Hey
THx for the points, but what was the problem?

partha