IPFS file upload

Hello,
I’m using this code to upload a file to ipfs but where I should add my infura key?
Thanks

<?php 
curl "https://ipfs.infura.io:5001/api/v0/block/put" \
    -X POST \
    -H "Content-Type: multipart/form-data" \
    -F file=@"/purpink.jpeg";
?>

Hi @damland - for the block_put command, you don’t need to include your Infura key. This command will return the block key and the size.

thanks @Leiya_Kenney
Is this the command to upload a file to ipfs?

<?php
curl "https://ipfs.infura.io:5001/api/v0/add?pin=false" \
    -X POST \
    -H "Content-Type: multipart/form-data" \
    -F file=@"/sample-result.json"
?>

no infura key also here

@damland - correct! That command will POST a file/directory to IPFS. This section of our docs provides you with all the optional params you can include, but again, no Infura key is required.

Thanks @Leiya_Kenney
even if now its not needed since its free, but how can I unpin a file that I’ve previously pinned using ipfs.infura.io:5001/api/v0/add?pin=false? and should I use pin=true to keep it pinned?

No problem - this thread can answer your pinning question.