Results 1 to 5 of 5

Thread: Upload File (Choose Location Online)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    71

    Upload File (Choose Location Online)

    I am creating a program that will help in upload files to a website. One of the things that the website uses is the "Upload File" button. When you push it an "Open" dialog box opens (like OpenFileDialoge). What I want the program to do is auto fill in the direct file location for the website. So that the dialog box won't open or won't need input.

    Hope this isn't confusing.

  2. #2
    Frenzied Member stateofidleness's Avatar
    Join Date
    Jan 2009
    Posts
    1,780

    Re: Upload File (Choose Location Online)

    you'd have to post the HTML of the "upload page"

    from there, it's just a matter of finding the input box's ID or Name and set the value of that attribute to your own filepath in string format

    then you just invoke the click method of the Submit button (again, look for its ID or Name attribute)

  3. #3
    Junior Member
    Join Date
    Mar 2010
    Posts
    25

    Re: Upload File (Choose Location Online)

    I am also having the same problem, I need to populate a input box without opendialog popup and call a javascript function to upload that image file. Below is the screenshot and html code. If anyone can help will be highly appreciated.





    HTML Code:
                <label><input id="profile_picture_option1" name="profile_picture_option" value="uploaded_image" type="radio">Upload an image:</label>
              </div>
              <div class="indented" style="margin-top: 10px;">
                <form style="display: block;" name="picture-upload-form" id="picture-upload-form" method="post" enctype="multipart/form-data" action="/my_profile_photo_post" target="action-target">
                  <input name="imagefile" id="imagefile" size="30px" onchange="Account.submitProfilePicture()" type="file">
                  <input name="session_token" value="NKBnkBiEJtVyqITarIYrpCRs3_h8MA==" type="hidden">
    
                  <p class="greyText" style="margin-top: 10px;">You can upload a JPG, non-animated GIF, BMP, or PNG file. Do not upload pictures containing celebrities, nudity, artwork or copyrighted images. Please upload an 800px by 800px image for best results. <b>Maximum file size is 2MB.</b></p>
                </form>
                <form name="picture-save-form" id="picture-save-form" method="post" action="/my_profile_photo_post" target="action-target">
                  <input name="command" value="save" type="hidden">
                  <input name="session_token" value="NKBnkBiEJtVyqITarIYrpCRs3_h8MA==" type="hidden">
                </form>
                <div style="display: none;" id="picture-upload-busy">
    
                  <img src="http://s.ytimg.com/yt/img/icn_loading_animated-vflff1Mjj.gif">
                </div>
        
                <div style="display: none;" id="picture-upload-preview">
                </div>
                <div id="picture-upload-again">
                  
                </div>
                
                <iframe id="picture-upload-target" name="action-target" src="about:blank" style="display: none;"></iframe>
              </div>
    
            </div>

  4. #4
    Fanatic Member
    Join Date
    Aug 2010
    Posts
    624

    Re: Upload File (Choose Location Online)

    Most of these type of HTML objects (as far as I know) Require the dialog to be opened, just try typing manually into the textbox next to the "browse" button, nothing happens right? You can't manually change the value, only the dialog sets the value. I would take a guess that, if this were possible, you would need to simulate the dialogbox's return result somehow. When faced with this kind of thing I usually just opt to push the "browse" button programmatically, most people prefer a dialogbox anyway.
    If I helped you out, please take the time to rate me

  5. #5
    Junior Member
    Join Date
    Mar 2010
    Posts
    25

    Re: Upload File (Choose Location Online)

    Hi, thanks for your reply. Is there any way I can manipulate the opendialog's return path?

Tags for this Thread

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