Last change
on this file since 29468 was 29468, checked in by sjs49, 9 years ago |
Initial commit for editor.method.ac for flag design
|
-
Property svn:executable
set to
*
|
File size:
737 bytes
|
Line | |
---|
1 | <!doctype html>
|
---|
2 | <?php
|
---|
3 | /*
|
---|
4 | * fileopen.php
|
---|
5 | * To be used with ext-server_opensave.js for SVG-edit
|
---|
6 | *
|
---|
7 | * Licensed under the Apache License, Version 2
|
---|
8 | *
|
---|
9 | * Copyright(c) 2010 Alexis Deveria
|
---|
10 | *
|
---|
11 | */
|
---|
12 | // Very minimal PHP file, all we do is Base64 encode the uploaded file and
|
---|
13 | // return it to the editor
|
---|
14 |
|
---|
15 | $file = $_FILES['svg_file']['tmp_name'];
|
---|
16 |
|
---|
17 | $output = file_get_contents($file);
|
---|
18 |
|
---|
19 | $type = $_REQUEST['type'];
|
---|
20 |
|
---|
21 | $prefix = '';
|
---|
22 |
|
---|
23 | // Make Data URL prefix for import image
|
---|
24 | if($type == 'import_img') {
|
---|
25 | $info = getimagesize($file);
|
---|
26 | $prefix = 'data:' . $info['mime'] . ';base64,';
|
---|
27 | }
|
---|
28 | ?>
|
---|
29 | <script>
|
---|
30 | window.top.window.methodDraw.processFile("<?php echo $prefix . base64_encode($output); ?>", "<?php echo htmlentities($type); ?>");
|
---|
31 | </script>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.