Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


bigal_nz

635 posts

Ultimate Geek
+1 received by user: 32
Inactive user


#153760 7-Oct-2014 07:12
Send private message

Hi All,

I need to find a way to progmatically and regularly (probably via cron) upload a file to a website which requires a login.

I cant see any php or aspx - looks all like html from this end.

Any thoughts on how to do this, like what language etc?

Regards

-Al


Create new topic
timmmay
20858 posts

Uber Geek
+1 received by user: 5350

Trusted
Lifetime subscriber

  #1148841 7-Oct-2014 07:41
Send private message

More details. Client, server, authentication type, file type. It's probably just a script doing basic auth, you can probably find something online.



hellonearthisman
1819 posts

Uber Geek
+1 received by user: 52

Trusted

  #1149030 7-Oct-2014 11:48
Send private message

If you can only see the HTML side of things then a Javascript/greasemonkey might be what you need.
But like Timmmay said, more details please.

solival
160 posts

Master Geek
+1 received by user: 20


  #1149120 7-Oct-2014 13:23
Send private message

You need CURL for that. But what kind of authentification there?
Is this http auth or sending some request to login and then receiving cookie?

Here example of curl upload command line:

 

curl -i -F name=test -F filedata=@localfile.jpg http://example.org/upload




Geek originally from Ukraine :)



timmmay
20858 posts

Uber Geek
+1 received by user: 5350

Trusted
Lifetime subscriber

  #1149377 7-Oct-2014 18:22
Send private message

Sometimes you can use something like  http://username:password@example.com/ to authenticate. Otherwise just a basic script that does the type of login required.

t92300
82 posts

Master Geek
+1 received by user: 24


  #1149465 7-Oct-2014 20:16
Send private message

You could try autoit if it can run on a windows machine. https://www.autoitscript.com
It can be scripted to open a browser, go to a web page log in and then fill out a form.




t92300
82 posts

Master Geek
+1 received by user: 24


  #1149530 7-Oct-2014 21:31
Send private message

If you want something php based you may be able to simple http://simpletest.org/en/download.html I have used it a few times to browse site and fill in forms. 
It makes Php pretend to be a web browser interact with pages. I havent tried it to do uploads though.

I think the class has lots of other functionality but I havent used that.




 
 
 
 

Shop now for Dell laptops and other devices (affiliate link).
bigal_nz

635 posts

Ultimate Geek
+1 received by user: 32
Inactive user


  #1152103 12-Oct-2014 11:12
Send private message

curl is what I need.

I have been trying with curl without much success.

Any curl experts here?

solival
160 posts

Master Geek
+1 received by user: 20


  #1152204 12-Oct-2014 14:33
Send private message

Not an expert, but I think I could help.
So, if you need to login to system and then upload file, first question is what kind of login used on web site?
There could be http auth used and regular login/pass via post used by most sites.




Geek originally from Ukraine :)

Create new topic








Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.