scratch – Diff between revs 87 and 90
?pathlinks?
Rev 87 | Rev 90 | |||
---|---|---|---|---|
Line 78... | Line 78... | |||
78 | } |
78 | } |
|
Line 79... | Line 79... | |||
79 | |
79 | |
|
80 | #### Store the file. |
80 | #### Store the file. |
|
Line -... | Line 81... | |||
- | 81 | $timestamp = atomized_put_contents($userPath.'.'.$fileExtension, $data); |
||
- | 82 | |
||
- | 83 | ### Hook for various file extensions. |
||
- | 84 | $opengraph = FALSE; |
||
- | 85 | switch(strtoupper($fileExtension)) { |
||
- | 86 | case 'GIF': |
||
- | 87 | $opengraph = TRUE; |
||
- | 88 | break; |
||
81 | $timestamp = atomized_put_contents($userPath.'.'.$fileExtension, $data); |
89 | } |
|
82 | |
90 | |
|
83 | ### Return the URL to the file. |
91 | ### Return the URL to the file. |
|
84 | header('Content-Type: text/plain; charset=utf-8'); |
92 | header('Content-Type: text/plain; charset=utf-8'); |
|
85 | echo json_encode( |
93 | echo json_encode( |
|
86 | array( |
94 | array( |
|
- | 95 | "hash" => $file, |
||
87 | "hash" => $file, |
96 | "timestamp" => $timestamp, |
|
88 | "timestamp" => $timestamp |
97 | "opengraph" => $opengraph |
|
89 | ) |
98 | ) |
|
90 | ); |
99 | ); |
|
91 | break; |
100 | break; |