## Uploading

Uploading — Uploading APIs and Asynchronous upload tickets.

## Synopsis

                        flickcurl_ticket;
    void                flickcurl_free_ticket               (flickcurl_ticket *ticket);
    void                flickcurl_free_tickets              (flickcurl_ticket **tickets_object);
                        flickcurl_upload_params;
                        flickcurl_upload_status;
                        flickcurl_user_upload_status;
    void                flickcurl_free_upload_status        (flickcurl_upload_status *status);
    void                flickcurl_free_user_upload_status   (flickcurl_user_upload_status *u);
    void                flickcurl_upload_status_free        (flickcurl_upload_status *status);

## Description

Uploading APIs and Asynchronous upload tickets.

## Details

### flickcurl_ticket

    typedef struct {
      int id;
      int photoid;
      int complete;
      int invalid;
    } flickcurl_ticket;

An aysnchronous photo upload ticket.

int `id`; | ticket ID
int `photoid`; | photoID
int `complete`; | complete flag
int `invalid`; | invalid flag

### flickcurl_free_ticket ()

    void                flickcurl_free_ticket               (flickcurl_ticket *ticket);

Destructor for ticket object

`ticket` : | ticket object

### flickcurl_free_tickets ()

    void                flickcurl_free_tickets              (flickcurl_ticket **tickets_object);

Destructor for array of ticket objects

`tickets_object` : | ticket object array

### flickcurl_upload_params

    typedef struct {
      const char* photo_file;
      const char *title;
      const char *description;
      const char *tags;
      int is_public;
      int is_friend;
      int is_family;
      int safety_level;
      int content_type;
      /* Flickcurl 1.22+ */
      int hidden;
    } flickcurl_upload_params;

Photo upload parameters

const char *`photo_file`; | photo filename
const char *`title`; | title or NULL
const char *`description`; | description of photo (HTML) (or NULL)
const char *`tags`; | space-separated list of tags (or NULL)
int `is_public`; | is public photo boolean (non-0 true)
int `is_friend`; | is friend photo boolean (non-0 true)
int `is_family`; | is family photo boolean (non-0 true)
int `safety_level`; | <=0 default, 1=safe, 2=moderate, 3=restricted
int `content_type`; | <=0 default, 1=photo, 2=screenshot, 3=other/artwork
int `hidden`; | <=0 default, 1=in global search, 2=hidden from publish searches (Flickcurl 1.22+)

### flickcurl_upload_status

    typedef struct {
      char *photoid;
      char *secret;
      char *originalsecret;
      char *ticketid;
    } flickcurl_upload_status;

An upload response.

char *`photoid`; | photo ID that was uploaded/replaced (upload only)
char *`secret`; | secret of photo uploaded (replace only)
char *`originalsecret`; | secret of original photo (replace only)
char *`ticketid`; | ticket ID for asynchronous upload (replace only)

### flickcurl_user_upload_status

    typedef struct {
      char* username;
      int bandwidth_maxbytes;
      int bandwidth_maxkb;
      int bandwidth_usedbytes;
      int bandwidth_usedkb;
      int bandwidth_remainingbytes;
      int bandwidth_remainingkb;

      int filesize_maxbytes;
      int filesize_maxkb;

      int sets_created;
      char* sets_remaining;
    } flickcurl_user_upload_status;

A user's upload status

char *`username`; | user name
int `bandwidth_maxbytes`; | max bytes
int `bandwidth_maxkb`; | max kbytes
int `bandwidth_usedbytes`; | used bytes
int `bandwidth_usedkb`; | used kbytes
int `bandwidth_remainingbytes`; | remaining bytes
int `bandwidth_remainingkb`; | remaining kbytes
int `filesize_maxbytes`; | max file size in bytes
int `filesize_maxkb`; | max file size in kbytes
int `sets_created`; | number of sets created
char *`sets_remaining`; | remaining sets: 0, 1, 2, 3 or "lots"

### flickcurl_free_upload_status ()

    void                flickcurl_free_upload_status        (flickcurl_upload_status *status);

Destructor - free a flickcurl_upload_status

`status` : | status object

### flickcurl_free_user_upload_status ()

    void                flickcurl_free_user_upload_status   (flickcurl_user_upload_status *u);

Destructor for user upload status object

`u` : | user upload status object

### flickcurl_upload_status_free ()

    void                flickcurl_upload_status_free        (flickcurl_upload_status *status);