Results 1 to 3 of 3

Thread: Webbrowser: submitting form and upload image

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    4

    Question Webbrowser: submitting form and upload image

    Hello, hope this is the right forum.
    I'm in the process of making a program to upload images at deviantart.com, but i'm facing 2 problems:
    First problem is that I need the program to somehow upload an image from a default/preset folder (means I have the image destination). The 2 attached images shows what this looks like. Either that (clicking upload button and choose the file through dialog) or setting the image path through the code somehow if thats possible? Here is the html code for the upload button:
    HTML Code:
                <a href="#" class="addfile" id="addfile_button" title="use this button to browse for a file on your computer and upload it to deviantART">
                    <form name="file_upload_1181809680" action="deckpost" enctype="multipart/form-data" method="post">
                        <input type="file" id="deck_file_upload"  name="deck_file"/>
                    </form>
                </a>
    Second problem is that when I have filled in all the text fields and chosen category (and manually uploaded image), I make the program submit the whole form to confirm image upload, but it gives me 4 errors:
    Description cannot be empty.
    Keywords cannot be empty.
    You need to agree to the submission policy in order to post deviations.
    You need to agree to the terms of service in order to post deviations.
    Although I have filled them out, and checked boxes. The code i'm using for this is:
    vb Code:
    1. WebBrowser1.Document.All("devtitle").Value = "test1" 'Title
    2.  
    3. WebBrowser1.Document.All("chooseCatBtn").Value = "Change..."
    4. WebBrowser1.Document.All("categoryId").Value = 357
    5. WebBrowser1.Document.All("categoryTitleDisplay").innerhtml = "Designs & Interfaces, Buttons" 'category
    6.  
    7. WebBrowser1.Document.All("devdesc").Value = "test2" 'description
    8.  
    9. WebBrowser1.Document.All("devkeywords").Value = "test3" 'keywords
    10.  
    11. WebBrowser1.Document.Forms("form3")("sp_agree").Checked = True 'Agree SP
    12. WebBrowser1.Document.Forms("form3")("tos_agree").Checked = True 'Agree TOS
    13.  
    14. WebBrowser1.Document.Forms(1).submit 'submit form
    and weird thing is when I let the program auto fill out everything, and I manually click the submit button, it works perfectly. The submit buttons html code:
    HTML Code:
    <input class="continue"  type="button" onclick="SPDeviation.nextScreen('deviation', 'save');" value="Submit" />
    Well I don't know if I need to program it to confirm more forms or something like that, but hope some of you guys can help me with that, and if anybody need the html code for the whole webpage, i've attached that too.

    Thanks to anyone who helps me.
    Attached Images Attached Images   
    Attached Files Attached Files
    Last edited by Trickster3D; Jun 16th, 2007 at 09:54 AM.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Webbrowser: submitting form and upload image

    Welcome to the forums.

    I don't think it belongs in network programming, but I'm not sure whether I should move it to the HTML section or the VB6 section.

    Do you know which part of your code is giving you the problems?

  3. #3

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    4

    Re: Webbrowser: submitting form and upload image

    Well I think the best place would be vb general then

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width