More than one file and/or directory was provided for pinning.
See original GitHub issueHello, when I want to send more than one file with Http Client or Guzzle in Laravel, “More than one file and/or directory was provided for pinning.” I am getting this response. What would you suggest I do?
public function client()
{
return Http::withHeaders([
'pinata_api_key' => config('services.pinata.key'),
'pinata_secret_api_key' => config('services.pinata.secret'),
])
->withUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36")
->withToken(config('services.pinata.accessToken'))
->baseUrl(
config('services.pinata.url')
);
}
public function uploadFiles(array $files = [])
{
if (count($files) === 0) {
return [];
}
$client = $this->client();
LazyCollection::make($files)->each(
fn($file, $key) => $client->attach(
"file",
File::get($file),
basename($file),
['mimeType' => 'application/octet-stream']
)
);
$response = $client
->asMultipart()
->connectTimeout(120)
->timeout(120)
->post('/pinning/pinFileToIPFS');
return $response->json();
}
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
pinFromFS: More than one file and/or directory was provided ...
In the README it is said that pinFromFS works with directories but applying to ./dist directory throws this error: [16:31:03] Error: More than...
Read more >Pin File or Directory - Pinata Docs
This endpoint will accept a single file or a single directory. The request must include a read stream for the payload in order...
Read more >Windows 10 Task bar Icon for Word and/or Excel, right click to
Windows 10 Task bar Icon for Word and/or Excel, right click to show recent or pinned files. How do I get the recent...
Read more >Pinata Listing A Directory of Files : r/ipfs - Reddit
Hello, Using the Pinata API currently, and can't seem to find documentation on how to return the objects within a folder.
Read more >How to Enable And Use Quick Access In Windows 11
You can just pin it to the Quick Action in File Explorer, and you can access ... It is designed to provide users...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bsormagec Usually takes 2 weeks. As soon as is approved and deployed in production, I’ll let you know!
@bsormagec This is now supported. let me know if you are able to upload a folder.