User bio
my video https://youtu.be/zx6WoApljBI
my story https://community.intersystems.com/post/45-years-intersystems-1978-2023
Member since Jul 21, 2017
Posts:
Replies:
Just as you, I start my CSP also from good old Studio
the EXIT button is inside <bod>y<form> ....<button>.. </form></body>
in upload
<!-- Copyright (c) 2001 InterSystems Inc. ALL RIGHTS RESERVED. -->
<csp:class description="Demo of how to upload a file from the browser.">
<html>
<head>
</head>
<body bgcolor="#CCCCFF">
<!-- display standard sample template using a custom tag -->
<isc:SAMPLE title="Upload a file Sample">
This sample uses an '<input type=file>' element in a form to upload a file
from the web browser to CSP. Pick a file and hit the submit button to try it.
</isc:SAMPLE>
<!-- HTML Form to submit the file. You must specify the enctype="multipart/form-data" -->
<!-- for this to work -->
<form enctype="multipart/form-data" method="post" action="upload.csp">
Enter a file to upload here: <input type=file size=30 name=FileStream>
<p>
<ul><input type="submit" value="Upload file"></ul>
<p>
<button onclick="window.close()" style="width: 100px; height: 40px; font-size: 18px;"> Exit </button>
</form>
<!-- As form is submitted to this page look to see if we have the stream in the %request object -->
<csp:if condition='($data(%request.MimeData("FileStream",1)))'>
<hr><br>
Submitted filename: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).FileName))#</b><br>
Size of file: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).Size))#</b><br>
Mime Section: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).MimeSection))#</b><br>
Type of stream: <b>#(..EscapeHTML($classname(%request.MimeData("FileStream",1))))#</b><br>
Content Type: <b>#(..EscapeHTML(%request.MimeData("FileStream",1).ContentType))#</b><br>
<br>
First 200 characters of stream:<br>
<ul>
<script language="Cache" runat="server">
New bytes
Set bytes=%request.MimeData("FileStream",1).Read(200)
Set bytes=##class(%CSP.Utils).DecodeData(bytes)
Write bytes,!
</script>
</ul>
</csp:if>
</body>
</html>
while your calling JS script is best located in <head>......</head>
<html>
<head>
<title>Demo for David</title>
<script language="JavaScript" type="text/javascript">
function importExtract()
{
var url='upload.csp' ;
var options = 'popup,status=yes,scrollbars=yes,resizable=yes,width=750,height=250' ;
newwindow=window.open(url,'UPLOAD',options);
newwindow.focus();
alert('back');
}
</script>
</head>
<body>
<h3>Demo for David</h3>
<Input type="button" value="Import Client Consultation Extract"
onclick="importExtract();"/>
</body>
</html>
I also struggled over that strange offset. and dropped the approach
Open Exchange applications:
Certifications & Credly badges:
Robert has no Certifications & Credly badges yet.
Global Masters badges:







Followers:
Following:
I'm fully in Sync with @Dmitry Maslennikov
Uniqueness is the TOP priority.
Though you can switch it off for rare cases by the class parameter MANAGEDEXTENT.
Concerning access speed, naming is not really relevant.
Top level of global storage is a sorted hierarchical directory structure that points to the globals.
So, on average, any global has - with actual storage speed - the same access time.
And global directory is mostly permanently cached in Global buffers.
BTW: You can list this directory using ^$GLOBAL()
set dir="^$GLOBAL("""")" for write dir,! set dir=$QUERY(@dir) quit:dir=""