Here is a high-level example of how you can accomp...
# best-practices
e
Here is a high-level example of how you can accomplish this using
append
and
cy.fixture
if you place your test file in the fixtures folder. ``` const createUpload = () => { cy.fixture('attachments/myFile.pdf', 'binary') .then((file) => Cypress.Blob.binaryStringToBlob(file)) .then((blob) => { const fileData = new FormData() fileData.append('file', blob, 'File Name ') fileData.append('user_insert_id', 'cypress.test') // whatever other values are needed return cy.request({ method: 'POST', url: 'Your URL', body: fileData, headers: { 'Content-Type': 'multipart/form-data', }, }) }) }