{"id":21944048,"url":"https://github.com/rfrench/poster","last_synced_at":"2025-04-22T21:05:11.736Z","repository":{"id":2837200,"uuid":"3840343","full_name":"rfrench/poster","owner":"rfrench","description":"node module for uploading local/remote files over multipart.","archived":false,"fork":false,"pushed_at":"2015-11-02T19:54:46.000Z","size":209,"stargazers_count":12,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T21:05:06.338Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rfrench.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-27T04:21:49.000Z","updated_at":"2023-11-11T20:50:25.000Z","dependencies_parsed_at":"2022-08-26T06:52:51.499Z","dependency_job_id":null,"html_url":"https://github.com/rfrench/poster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfrench%2Fposter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfrench%2Fposter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfrench%2Fposter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rfrench%2Fposter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rfrench","download_url":"https://codeload.github.com/rfrench/poster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250324689,"owners_count":21411945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T04:13:08.960Z","updated_at":"2025-04-22T21:05:11.715Z","avatar_url":"https://github.com/rfrench.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# poster\nAsync node module for uploading local/remote files over multipart.\n\n## Install\n\u003cpre\u003e\n  $ npm install poster\n\u003c/pre\u003e\n\n## post(uri, options, callback[err, data])\n\n### Options\n - `uploadUrl`: Upload URL. (required)\n - `method`: HTTP method type. Defaults to `POST`.\n - `fileId`: File ID parameter name of the file. Defaults to `Filedata`.\n - `fields`: Optional form parameters.\n - `maxFileSize`: Maximum file size allowed to be uploaded in bytes. Disabled by default.\n - `fileContentType`: Content type of the file being uploaded. Defaults to 'application/octet-stream'.\n - `downloadFileName`: If supplied, this will override the parsed file name from the url.\n - `maxRedirects`: Total # of redirects allowed before giving up downloading the file. Defaults to `5`.\n - `downloadHeaders`: If supplied, these headers will be sent when downloading the file.\n - `uploadHeaders`: If supplied, these headers will be sent when uploading the file.\n - `headers`: If supplied, these headers will be sent for both downloading and uploading.\n - `downloadAgent`: Use your own http.Agent for downloading files. Defaults to the global agent.\n - `uploadAgent`: Use your own http.Agent for uploading files. Defaults to the global agent.\n - `agent`: If supplied, this value will use the same agent for both the downloadAgent and uploadAgent.\n\n## Examples\n\n### Stream local file\n``` js\nvar poster = require('poster');\n\nvar options = {\n  uploadUrl: 'http://mysite.com/upload',\n  method: 'POST',\n  fileId: 'file',\n  fileContentType: 'image/jpeg'\n  fields: {\n    'myfield': 'value',\n    'myfield2': 'value2'\n  }\n};\n\nposter.post('file.jpg', options, function(err, data) {\n  if (!err) {\n    console.log(data);\n  }\n});\n```\n\n### Stream remote file\n``` js\nvar poster = require('poster');\n\nvar options = {\n  uploadUrl: 'http://mysite.com/upload',\n  method: 'POST',\n  fileId: 'file',\n  fields: {\n    'myfield': 'value',\n    'myfield2': 'value2'\n  }\n};\n\nposter.post('https://www.google.com/logos/2012/addams11-hp.jpg', options, function(err, data) {\n  if (!err) {\n    console.log(data);\n  }\n});\n```\n\n## BYOA (Bring Your Own Agent)\n\u003cpre\u003e\n  $ npm install tunnel\n\u003c/pre\u003e\n\n``` js\nvar poster = require('poster');\nvar tunnel = require('tunnel'); //only works with 0.6.11+\nvar proxyAgent = new tunnel.httpOverHttp({\n  proxy: {\n    host: 'myproxy.com',\n    port: 80\n  }\n});\n\nvar options = {\n  uploadUrl: 'http://mysite.com/upload',\n  method: 'POST',\n  fileId: 'file',\n  fields: {\n    'myfield': 'value',\n    'myfield2': 'value2'\n  },\n  downloadAgent: proxyAgent\n};\n\nposter.post('https://www.google.com/logos/2012/addams11-hp.jpg', options, function(err, data) {\n  if (!err) {\n    console.log(data);\n  }\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfrench%2Fposter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frfrench%2Fposter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frfrench%2Fposter/lists"}