is possible to upload my local image file with my local javascript/prototype code on existing site ?
existing site has its own upload file dialog window, but I want upload the file bypassing existing dialog window
is possible to upload my local image file with my local javascript/prototype code on existing site ?
existing site has its own upload file dialog window, but I want upload the file bypassing existing dialog window
Yes, it's possible but probably not a good idea to allow anyone to upload random stuff to your website. If it's not your website but belongs to someone else, one might ask why you want to do this.
Try Google for "JavaScript file upload".
pls look:
existing form
from this site (need login) https://999.md/add?category=furnitur...offer_type=776Code:<form id="js-add-form" action="" class="board__content container_25 cf" method="post" data-confirm-text="Вы уверены, что хотите уйти с этой страницы? Несохраненные данные будут потеряны!"> <a href="" id="fileupload-button">Добавить фотографию</a> <input id="fileupload-file-input" name="file" accept="image/gif, image/jpeg, image/png" style="position: absolute; top: -10000px" multiple="" type="file"> <section class="board__content__photo__body grid_20" style="display: none;" id="filupload-media-container"> </section> <button class="board__content__further__body"><span>далее</span></button>
this form uses main.js - https://www.evernote.com/shard/s212/...65f34cab8ee10b
I want to fill this form with selenium... as automation test... w/o File Upload Dialog window
I can with selenium to fill all fields except [image upload]
I can put image file to input field with selenium
but I can't understand what (and how) method/function I should initialize from main.js that my file from input field will be uploaded to serverCode:browser.file_field(:id, "fileupload-file-input").set '//1.jpg'
I practical don't know prototype. and little bit know javascript
this tag
<a href="" id="fileupload-button">Добавить фотографию</a>
uses the follow event
and this tagCode:return function(e) { return e.preventDefault(), t.openFileUploadDialog() }
<input id="fileupload-file-input" name="file" accept="image/gif, image/jpeg, image/png" style="position: absolute; top: -10000px" multiple="" type="file">
uses
I need upload file w/o dialog windowCode:return function(o) { var n; return n = o.currentTarget.files, t.each(n, function(t, o) { return e.options.remaining > 0 ? e._upload(n.item(o)) : void 0 }), e.options.nodes.fileInput.val("") }
with selenium I put file to input field
but what next I dont knowCode:browser.file_field(:id, "fileupload-file-input").set '//1.jpg'
how to upload my file from input field to server ?![]()
Bookmarks