tencent cloud

Performance Testing Service

Related Agreements
Service Level Agreement
Use Limits
Privacy Policy
Data Processing And Security Agreement
문서Performance Testing Service

File

포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-03-10 17:04:49
File represents the file object used for upload in FormData, which is generated by http.file.

Field

Field
Type
Description
contentType
string
Content type, defaults to "application/octet-stream".
data
string or ArrayBuffer.
File content, usually using the return value of open().
name
string
File name, defaults to timestamp in nanoseconds.

Samples

import http from 'pts/http';

const data = open('./sample/tmp.js');

export default function () {
const file = http.file(data, 'data', 'application/json');
console.log(file.data.length); // 231
console.log(file.name); // data
console.log(file.contentType); // application/json
}


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백