Supabase file uploading occasionally fails - supabase

Sometimes I can upload a file and sometimes I get this error:
{statusCode: '403', error: '', message: 'new row violates row-level security policy (USING expression) for table "objects"'}
I got the uploading code from this page. I duplicated the component with different bucket names and only changed htmlFor, id, accept and bucket url, both with the same policies but sometimes the other works/fails or both. One is for image upload and the other video, both have worked at some point so idk why I keep getting the error. And none of the files exceeds the max upload size(50mb). Heres SQL snippet I used:
insert into storage.buckets (id, name)
values ('avatars', 'avatars');
create policy "Avatar images are publicly accessible." on storage.objects
for select using (bucket_id = 'avatars');
create policy "Anyone can upload an avatar." on storage.objects
for insert with check (bucket_id = 'avatars');
Also I'm using Typescript and no error in my code.

Related

Power Automate issue from Microsoft Form Get Responses trigger, where email attachment File Content shows previous submission

I have created a Quality Audit in Microsoft Forms that I've Power Automated. This is the first flow i've ever built and could use some help!
After the trigger of When a new response is submitted, the flow works as follows:
Add a row into a table (this works in parallel with the Update a Row below - i'm having no issues with this step)
Update a Row in a table to act as an individual scorecard - where the table has all of the Form questions and the row updates based on the corresponding Get Response Details. Basically all submissions would use the same base Excel file in Onedrive, that has a template that shows the Get Response Details and calculates a score based on an IF formula.
Copy File saves a copy of the template scorecard to the same Onedrive folder, with a unique file name based on the Get Response Details of employee name, date, and form ID.
Get File Metadata Using Path - identical to the path of the Copy File above.
Get File Content based on the ID of the Get File Metadata.
Send an email (V2) to the manager with an attachment (using the Display Name of the Copy File & File Content).
Beginning of flow
Send email V2 flow
As for the problem, after the Form is submitted, the email attachment reflects the File Content of the previous form submission and not the current. But what I interesting is that:
The name of the file is correct based on the Copy File step.
When I look at the actual copy of the file saved to Onedrive - it's correct with all the right info. It's only the email attachment that seems to be an issue.
When I manually re-submit the trigger from the 28 Day Run History, this time the File Content of the emailed scorecard is accurate. Even when it's re-submitted seconds to minutes of the initial submission.
To try to fix:
Added in a Delay (30 seconds to 2 minutes) at various steps thinking that perhaps the flow was completing too quickly - it was copying the file and sending the emailed attachment before the system could update the table. But this had no effect.
Used different dynamic content for the Get File Metadata/Content steps. In addition to ID, I also tried by File Path, Name, & Etag. I also tried the ID of the Copy File instead of the File Metadata. These had no effect.
Did the Copy File first - meaning I saved a copy of the initial blank scorecard to a unique file name and then did Update a Row based on said copied file. But because Update a Row works can only work off one single file and does not have an option for File Path - I could only use ID of Copied File, which did not work.
Tried using Sharepoint instead of Onedrive - same deal.
Used Share Link to Web URL - but when you click the link - it also takes you to a form with the right file name, but the previous submissions file content.
Ideally I need the initial Form submission to show the right data in the emailed scorecard the first time, because I'm not going to go through and manually re-submit the trigger each time a new form is submitted.
Any help and suggestions are greatly appreciated!!

IMPORTXHTML giving could not fetch url error from nasdaq in Sheets

I'm trying to get data from the row open interest to appear in my Google Sheets. I have tried both IMPORTHTML and IMPORTXML, but I keep getting the could not fetch url error. Here is the current code I am working with.
=IMPORTXML(CONCATENATE("https://www.nasdaq.com/market-activity/funds-and-etfs/spy/option-chain/call-put-options/spy---201224c00370000"),"//tr[text()='Open Interest']/td")
When I inspected the table every row has the same class, so I can't select by class, same goes for header. So I'm not sure how to access the line once the URL can be fetched
I have tried http: and https:, that's not it.

Microsoft Access unable to display image attachment (Runtime Error 2220)

I have a table called "Subsidiary Companies" where I store the names of different subsidiary companies and their corresponding company logo images as an attachment in a table.
I have a form called "invoice" where I use it to generate invoices. Whenever I select a subsidiary from a Combobox, it will change the image attachment box on my form to the one corresponding to the company selected.
After I attach the image to the table it worked. When I closed my entire access program and went back to it, it doesn't work anymore even though I did not change any codes, settings or image path. I got an error instead, "Runtime Error 2220: Microsoft Access can't open the file image.jpeg".
Here is my code to select the attachment image based on the company selected:
Me.AttachmentCompanyLogo.DefaultPicture = Me.ComboboxCompanySelection.Column(1)
Not sure where it went wrong as I am not very familiar with Access, would appreciate some help, thank you :)
based on this statement: " When I closed my entire access program and went back to it, it doesn't work anymore"
that behavior would occur if you failed to also include the primary/foreign key cross reference value in the record. such that when you next go to select it - it can't be found because when you added the image/path it also needed the key value as a cross reference...
this is just a guess of course...
look directly at the table and see if this data is missing...
on a different topic; if you have only a small quantity of images the use of attachments is ok however if there will be a larger quantity then one should not use the attachments feature and instead store the image docs in a separate folder while putting the path to the image doc in a table.

Update CreatedDate property for Google drive documents using DRIVE API

We are using Google Drive API for uploading data to Google team drive.
https://developers.google.com/apis-explorer/#p/drive/v3
Need advice on below issues.
We wanted to modify CreatedTime field of document which is uploaded to custom date(past date). When we try to update this, we are getting error
"The resource body includes fields which are not directly writable "
Can you please advise if is there any way to update CreateTime to custom date(rather than date when document is getting uploaded)
Same way we also wanted to update CreatedBy property, what we see that Google Drive document has owners property which hold the value of the user who has uploaded document. As we are uploading from custom code we wanted to set this to custom value. Can you please advise if this is possible as we are getting error "The resource body includes fields which are not directly writable "
Not all the files are updatable with the API. Logically speaking a create date is just that the date a file is created changing that would result in invalid data as it would not be true the date it was created was the date it was created.
There is really no way you are going to be able to fix this unless you want to create a file in an hour in which case i sugest you create a new file then and copy the data to that date. This will of course not work if you want to create a file in the past

apex_util.get_blob was not found on this server

I am trying to develop an interactive report in which I am using blob column to download the blob file (that could be jpeg or pdf). I created the download field on the blob column but, when I clicked on it, it gives an error as mentioned below.
"The requested URL /apex/apex_util.get_blob was not found on this server"
Note: I am using oracle apex 5.1.2.
Can anybody please help me to resolve this error.
Suppose that BLOB column is named BLOB_COLUMN, and it contains JPEG or PDF. It is one of column in SELECT statement you used to create an interactive report.
By default, BLOB_COLUMN's type is "Plain text". If you just changed it to Download BLOB and filled required BLOB attributes, well - it won't work.
Instead, you should create yet another column in IR's SELECT:
select ...,
dbms_lob.getlength(blob_column) download_blob
from ...
and apply BLOB attributes to it. I've just tried it on apex.oracle.com, works as expected. If it still doesn't work for you, please, create an example on the same site, provide credentials so that someone of us might have a look.
at the BLOB attributes there is a Primary key column. The get_blob uses the same column value from the report to fetch the blob from the given table. So, if you have two ID columns in two tables (joined report) you have to create a view for the other table and use an other column name as ID in it. Use this view and the new ID column name as a PK.

Resources