Manol T.
Manol T.
Explore posts from servers
WWasp-lang
Created by Manol T. on 11/29/2023 in #đŸ™‹questions
How to store client secrets?
hey, @martinsos , here's the working code for azure: https://github.com/AIAccelerator/BookPlanner/commit/d944956e991179857a3301e40f3819f7bcb3c059 My primary issue with the access in Azure - it was set to private and I wasn't able to uplaod there. As a second thing, my SaS token (the access token) didn't have writing rules. It was a matter of deeper understanding how the azure storage works (although i work with it for a first time). thanks for the help!
8 replies
WWasp-lang
Created by Manol T. on 11/29/2023 in #đŸ™‹questions
How to store client secrets?
I am able to upload a file through curl request by passing the file directly to curl, but i didn't manage to make the react part working ..
8 replies
WWasp-lang
Created by Manol T. on 11/29/2023 in #đŸ™‹questions
How to store client secrets?
this is my curernt implementation: const uploadFileToBlob = async (data) => { if (!(data.file && data.file.length > 0)) { return; }
const file = data.file[0]; const fileName = await fileUpload(file, 'bookgpt'); console.log(fileName); };
async function fileUpload(file, containerName) { try { let storageAccount = "bookgpt"; const sasToken = encodeURI('sas token here');
const blobService = new BlobServiceClient( https://${storageAccount}.blob.core.windows.net?${sasToken} );
const containerClient = blobService.getContainerClient(containerName); const blobName = encodeURIComponent(file.name); const blobClient = containerClient.getBlockBlobClient(blobName);
const options = { blobHTTPHeaders: { blobContentType: file.type, 'Access-Control-Allow-Origin': '*', }, };

const fileData = await readFileDataAsBinaryString(file); console.log(fileData); const uploadBlobResponse = await blobClient.uploadData(fileData, options); console.log("Blob was uploaded successfully. requestId: ", uploadBlobResponse.requestId); const fileString = https://${storageAccount}.blob.core.windows.net/${containerName}/${blobName}; return fileString;
} catch (error) { console.error("Error uploading file to Azure: ", error); throw error; // Or handle the error as needed } }
8 replies
WWasp-lang
Created by Manol T. on 11/29/2023 in #đŸ™‹questions
How to store client secrets?
this part: https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-javascript-get-started?tabs=azure-ad#create-blobclient-directly where they upload the file, but i use SaS token (the last tab). There's discrepancy in the source code, in the part for SaS they do not have an uploading code, The thing is, i should convert the file object into a stream either a text content / array buffer. Unfortunately I am not aware how to acheieve this trhough react
8 replies
WWasp-lang
Created by Manol T. on 11/29/2023 in #đŸ™‹questions
How to store client secrets?
hello, I am sorry for the late reply. I began integrating the azure blob uploading feature. this is a sample documentation: https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-upload-javascript
8 replies
WWasp-lang
Created by Manol T. on 10/28/2023 in #đŸ™‹questions
Blank Page when start the app
Hello, I just solved the issue, it seems to be a mispelled class export in the react component. I took a look into the browser console section and it told me the error.
3 replies
WWasp-lang
Created by Manol T. on 10/25/2023 in #đŸ™‹questions
Wasp cannot find wasp root after downloading MageGPT app
thank you!
10 replies
WWasp-lang
Created by Manol T. on 10/25/2023 in #đŸ™‹questions
Wasp cannot find wasp root after downloading MageGPT app
when I was copy pasting
10 replies
WWasp-lang
Created by Manol T. on 10/25/2023 in #đŸ™‹questions
Wasp cannot find wasp root after downloading MageGPT app
I see, it might be something ubuntu related
10 replies
WWasp-lang
Created by Manol T. on 10/25/2023 in #đŸ™‹questions
Wasp cannot find wasp root after downloading MageGPT app
10 replies
WWasp-lang
Created by Manol T. on 10/25/2023 in #đŸ™‹questions
Wasp cannot find wasp root after downloading MageGPT app
I've placed .wasproot file and it is working now. This file was not part of the zip which I've downloaded
10 replies