Jump to content
UBot Underground

how to upload image in WP (U4)


Recommended Posts

Gents,

 

Any idea how to upload images in wordpress using ubot4?

I've checked old topics (ubot3.5) but it doesn't work now.

 

Any code samples?

Many thanks in advance.

 

Wacek

Link to post
Share on other sites

Hi Praney,

 

I've tried your solution - http://ubotstudio.com/forum/index.php?/topic/6655-posting-up-images-in-wp

it's great for u3.5 however it needs a different shape and form in u4 as you there is no set active windows and no set dialog text commands available.

 

Such a small thing, while very frustrating.

I guess there is a workaround and I might be missing something

 

I can click on Choose file button, but then I'm unable to fill the file name and click OK.

Link to post
Share on other sites

Here you go man :

 

click(<id="add_image">, "Left Click", "No")
change file field(<name="async-upload">, "#filename")
click(<name="html-upload">, "Left Click", "No")
wait for browser event("Page Loaded", 30)

 

Hope it helps. :)

 

Praney

Link to post
Share on other sites

Hi Praney, first of all, thanks for your code.

 

Somehow it doesn't work for me.

 

here what I have right now:

// set path to image to be uploaded
set(#imgupload, "{$special folder("My Documents")}\\WRuskiContent\\imgorg.jpg", "Global")
//go to media - add new
click(<href="media-new.php">, "Left Click", "No")
wait(2)
//click Choose file
click(<name="async-upload">, "Left Click", "No")
wait(1)
// insert path to image to be uploaded
change file field(<name="async-upload">, #imgupload)
wait(1)
//click Upload
click(<name="html-upload">, "Left Click", "No")
wait for browser event("Page Loaded", 30)

 

The code doesn't work for me, I was playing with Wait command, but no results there.

 

Is there something worng with the code?

Does it work for you mate?

 

many thanks again

Link to post
Share on other sites

It seems like a tiny mistake in your code, its missing "" on the #imgupload variable.

 

// set path to image to be uploaded
set(#imgupload, "{$special folder("My Documents")}\\WRuskiContent\\imgorg.jpg", "Global")
//go to media - add new
click(<href="media-new.php">, "Left Click", "No")
wait(2)
//click Choose file
click(<name="async-upload">, "Left Click", "No")
wait(1)
// insert path to image to be uploaded
change file field(<name="async-upload">, "#imgupload")
wait(1)
//click Upload
click(<name="html-upload">, "Left Click", "No")
wait for browser event("Page Loaded", 30)

 

May wanna try this..

 

Praney

Link to post
Share on other sites

I believe I was testing both,

change file field(<name="async-upload">, "#imgupload")

and

change file field(<name="async-upload">, #imgupload)

no result in either case

 

What it does is, after

click(<name="async-upload">, "Left Click", "No")

file upload window pops out, but next commands are unable to fill the file name field.

 

so:

change file field(<name="async-upload">, "#imgupload")

doesn't work in my case

 

Does the code work for you Praney?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...