Selaa lähdekoodia

sqlpage.uploaded_file_path and sqlpage.uploaded_file_mime_type must be called before sqlpage.run_sql

Daniel Sheffield 4 kuukautta sitten
vanhempi
säilyke
3632ec66d1
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      util-sqlpage/upload.sql

+ 4 - 1
util-sqlpage/upload.sql

@@ -1,3 +1,6 @@
 SET inner = 'upload/Index.sql';
-
+-- although using a variable works, docs say to pass the function as first argument
+-- https://sql.ophir.dev/functions.sql?function=read_file_as_data_url#function
+SET data_uri = sqlpage.read_file_as_data_url(sqlpage.uploaded_file_path('content'));
+SET mime_type = sqlpage.uploaded_file_mime_type('content');
 SELECT 'dynamic' AS component, sqlpage.run_sql('upload/entry.sql') AS properties;