Skip to content

Commit 66792ac

Browse files
committed
fix picture upload example
1 parent 6f09513 commit 66792ac

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed
Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
select 'card' as component;
2-
select 'Your picture' as title;
1+
select 'shell' as component, 'SQLPage' as title, '/' as link;
32

4-
select 'debug' as component;
5-
select :my_file as file;
3+
select 'title' as component, 'SQLPage Upload Demo' as contents;
4+
5+
select 'card' as component, 1 as columns;
6+
select 'Your picture' as title,
7+
sqlpage.read_file_as_data_url(
8+
sqlpage.uploaded_file_path('my_file')
9+
) as top_image;
10+
11+
select 'debug' as component,
12+
sqlpage.uploaded_file_path('my_file') as uploaded_file_path,
13+
sqlpage.uploaded_file_mime_type('my_file') as uploaded_file_mime_type;
14+
15+
select 'form' as component;
16+
select 'my_file' as name, 'file' as type, 'Picture' as label;

examples/official-site/sqlpage/migrations/01_documentation.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ INSERT INTO uploaded_file(name, data) VALUES(:filename, sqlpage.uploaded_file_da
396396
```
397397
',
398398
json('[{"component":"form", "title": "Upload a picture", "validate": "Upload", "action": "examples/handle_picture_upload.sql"},
399-
{"name": "my_file", "type": "file", "accept": "image/png, image/jpeg", "label": "Picture", "description": "Upload a nice picture", "required": true}
399+
{"name": "my_file", "type": "file", "accept": "image/png, image/jpeg", "label": "Picture", "description": "Upload a small picture", "required": true}
400400
]')),
401401
('form', '
402402
## Bulk data insertion

0 commit comments

Comments
 (0)