Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Login and Upload via Desktop Application using Visual Basic  (Read 4001 times)

0 Members and 1 Guest are viewing this topic.

kalyanalee

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Login and Upload via Desktop Application using Visual Basic
« on: March 28, 2016, 05:13:41 pm »

Dear Admin and Anyone,

I want to create a desktop application. Within this application, we could type username and password to login. Then, we could upload files to a specific album.

Please help me to do this.

Thank you very much.
Logged

kalyanalee

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Login and Upload via Desktop Application using Visual Basic
« Reply #1 on: March 29, 2016, 02:02:53 am »

Dear Admin and Anyone,

Could you help me to understand the process of login and posting in Coppermine?

Thank you.

Regards.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Login and Upload via Desktop Application using Visual Basic
« Reply #2 on: April 06, 2016, 11:44:50 am »

When you login to Coppermine, it will create a session cookie for authentication. It has no fixed name, but is generated from the user's browser agent:
Code: [Select]
$this->client_id = md5($superCage->server->getRaw('HTTP_USER_AGENT').$CONFIG['site_url']);
For more information, please have a look at bridge/coppermine.inc.php, especially at the *session* functions.


Regarding uploading I haven't checked the code yet how this is possible yet. I think ron4mac currently has a more extensive comprehension at the upload process and knows where/how you have to send your files to (probably upload.php). Maybe he replies to this thread.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15760
Re: Login and Upload via Desktop Application using Visual Basic
« Reply #3 on: April 06, 2016, 04:48:37 pm »

I just had a closer look at the simple upload form. It sends its data to db_input.php:
Code: [Select]
method html_single
album 6
userpicture <binary data here>
title my title
caption my description
keywords my_keyword
event picture
form_token ea90851a5f7ec9185adf179286ed12f3
timestamp 1459953277
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 1814
Re: Login and Upload via Desktop Application using Visual Basic
« Reply #4 on: April 06, 2016, 08:09:03 pm »

As all submitted input to CPG is protected by use of a form_token, any desktop application would have to mimic the act of logging in by receiving the login form (and its token/timestamp), then send the credentials along with the token/timestamp. After succeeding in doing that, the same method would need to be done to get the upload form and send the appropriate things back to CPG along with the new token/timestamp.

It is also likely that you would have to maintain 'cookie' information in the data transfers to accomplish this.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.