gzip and zip are not the same thing. If you are trying to create a .zip, you need to use zip.
It's probably not finding your test001.zip because it's creating a test001.zip.gz.
- Log in to post comments
gzip and zip are not the same thing. If you are trying to create a .zip, you need to use zip.
It's probably not finding your test001.zip because it's creating a test001.zip.gz.
.gz and .zip files are two very, very different things. You can't just rename a gz to zip and expect it to work.
We haven't tried using it for ObjectScript, but we do have some customers who use Crystal Reports who have tried using it to help set those up, and it has been very questionable for that. It definitely doesn't understand what's where in the database structure, and even basic formula fields seem to be far more complicated than necessary.
If you want to treat them as lists, you probably want to use $LISTFROMSTRING along with $LISTGET, $LISTFIND, and $LISTLENGTH. All of which can be abbreviated to their initials, by the way - $LFS, $LG, $LF, $LL.
set y = $LFS("Red,Green,Orange,Yellow")
set x = $LFS("Purple,Black,Yellow,Pink")
for i=1:1:$LL(x){
if $LF(y,$LG(x,i)) > 0 {
write $LG(x,i)_" found in both lists!",!
//Or whatever else you want to do when you find a match here . . .
}
}By the time I started learning ObjectScript, I had already been exposed to varying degrees to Java, javascript, PHP, C#, C++, Visual Basic, Python, and ActionScript, so to me it was different, but I was kind of used to finding my way around the quirks of a new object-oriented language.
One thing that does make it more difficult with ObjectScript in this community, though, is that so many things can be abbreviated in code, and that makes it harder for beginners to read and follow up on. For example, you might see {}.%New() or {}.%FromJSON(). It might take some time to figure out that if you want to look up further documentation on what that is, you have to look at the %Library.DynamicObject class, and that you could also use ##class(%Library.DynamicObject).%New(). Commands like set, do and for get shortened to s, d, and f. Functions like $ZDATETIME get shortened to $ZDT. We mention things like $$$ThrowStatus assuming you'll know that if you're writing a routine, you have to have #include %occStatus at the top to use that.
It's something that, once you figure it out, it's easy to understand, but those of us writing articles on here could also do a better job of writing our code samples to be readable.
If it's null, your code might not even be getting to the Post method. Are you running this in the terminal, and are you getting any other errors there? Is your RTLS SSL configuration set up in the management portal?
Also, when the response comes back, it's JSON, so if you want to get just the token, you'd have to:
set AuthTokenValue = tokenObj.%Get("access_token")
If you're using a dynamic object to set the value, there is an optional third argument to the %Set method where you can specify the data type. So if you use myobject.%Set("testingID",1234567,"number") it will be added as a number.
I've never done it this way, just by overriding those methods in the class definition containing the property, but I do know in that case Set has to take a value as an argument. Maybe it's not recognizing your Set method because it doesn't match the signature of the usual Set method. When you override it in a class, it looks like this:
In that case, Arg is the value that the process is trying to set the value of the property to. So it might have to be something like:
Method Set(Arg as %String){ S %val = "asd" Q 1}
Or if you wanted to some something with the input value, you could use Arg to do that?
I don't have an answer, but I also hope someone does. // is specifically for a single-line comment, so it's odd to me that it's continued like that.
Yes, you do have to tread lightly and program very carefully if you mess with those. Errors in them could make it impossible to start or log into IRIS. This is straight from the documentation about those routines:
Make sure that the routines are well-behaved under all possible conditions. They should be written defensively. That is, they should check to make sure that all the resources needed to complete their task are at hand and, if possible, reserved to them before computation starts. Errors which occur are reported as failures of that system function so it is important to think about the design from the viewpoint of error containment and handling. Failure to properly account for recovery in the face of missing resources or the presence of errors has varied consequences: InterSystems IRIS may fail to start; major functions such as Studio may act strangely; or more subtle and insidious consequences may occur which are not immediately detected. It is strongly recommended that these routines be carefully written and debugged under simulated conditions, and then tested under simulated environment conditions before being put into production systems.
It doesn't sound like you're trying to do anything too crazy, but do make sure you trap or catch any potential errors anyway.
Emil, if the request is not coming from a form with the enctype set to multipart/form-data, can you give us an example of how the request is being created? Maybe the issue is that the request has not been created properly.
When using $EXTRACT, you use a * to signify an offset from the end of a string. So if you did $EXTRACT(Str,1,*-1) you would have the string with the last character removed.
Also note that the arguments for the $EXTRACT are the string, the starting character, and the ending character, so in the examples you gave, you're actually telling it to extract from Str starting at Length(Str)-1. You need to have a 1 in there as the second argument to go from the beginning to that character.
You say you've been able make the tables read only and not "everything". What are the accessing besides tables?
You can also use the $ROLES special variable to do that. It contains both the user's assigned roles and any roles you've added during the process. You can't change the user roles, but if you set it that will add a role. So you could do:
set $ROLES = "%All"
Or whatever role you need to add, then do the stuff that requires that roles, then do:
set $ROLES = ""
That will take away the %All role you added, reverting the process to just the user's normal roles.
Is $LISTBUILD what you're looking for?
If your IDList is a string, you'd have to use WHERE 10 %INLIST $LISTFROMSTRING(IDList,' ') so that the string is converted to an actual list for %INLIST to work.
Maybe that's old code that's been carried over through some copying and pasting. I have a Cache 2012 instance and Name is not required in it.
Just to be clear, are you trying to run the OS-level command on the server, or on the client?
If you're trying to run it on the server, check the documentation for the $ZF -100 command.
If you're trying to run it on the client, you're going to run into all kinds of security issues, and for very good reasons.
Edit: just saw that you're on Cache 2013. You might have to use $ZF -1 instead of -100.
In my opinion, if you have a page that doesn't necessarily need to have any user interface elements - %CSP.StreamServer is a good example - that's the primary case for extending %CSP.Page. If you need a UI, then a csp page is easier to deal with.
@Marc Mundt's comment here might be helpful. You'll need to instantiate some %Net.MIMPart objects, put them together, and send them.
My mistake, Scott, I thought you just had Apache running on its default ports and were trying to figure out how to make the other requests also go there.
The requests using port 52773 aren't even going to get to Apache, so you can't solve this problem by changing your Apache configuration. You would have to make your router forward traffic between your server and your other PCs on port 52773 to port 80 (for HTTP) or port 443 (HTTPS).
Could you maybe use $LISTTOSTRING using a delimiter that works for you (something unlikely to be in your actual list data), convert that to uppercase, then use $LISTFROMSTRING to get it back into $LIST format with everything capitalized and not breaking the list?
That's an issue with the SSL certificate on the server. It's the kind of error you'd see if the domains on the SSL certificate don't match the domain being used to access the website. SSL certificates are a little out of my areas of expertise, so I'm not sure how you determine what you need to do to fix that.
If this is on a Windows machine, IIS will return a 404.8 error when its "hidden segment" request filtering blocks something.
Yes, security settings can get down to a columnar level. Also, if what you're querying is a view rather than a table, or if the ID column is defined to be something other than ID, that column just might not exist.
Also for clarification, when you use the select *, are you getting an Id column in the resulting data?
I haven't touched PHP in a bit, but are you binding your columns? I seem to remember PHP things getting a little finicky about making sure you do that before you fetch if you were specifying columns in the query, but not if you were doing a select *.
I didn't check the credentials because this all takes place after the user has already been through the authentication process. If they aren't valid, they wouldn't get this far anyway. My approach is dealing with just the authorization, not the authentication. I still use $SYSTEM.Security.Check to see if the process has the right permissions.
As you said, it comes down to personal preference. One of my preferences is not messing with the authentication processes if I don't have to. That way I don't have to account for all of the different authentication options, and they could all still be used.
I was actually pondering this question myself for an article I'm working on. I ended up in a very different place than you did, though. I created an Abstract class that extends %CSP.REST and overrides the XData schema, the DispatchMap method, and the DispatchRequest method. If I extend this class - which I've called REST.Resourceful - I can include a resource in the URL map as a resource:permission pair. For example:
Will only allow you to access the /securetest endpoint if the user has Use permission on the resource "MyResource". If you don't, you get a 401 error. If I leave out the Resource attribute on that node, it doesn't check for any additional resources.
Source code is below. If you search the text for my initials, DLH, you'll see comments where I've made changes in the method, plus I added the attribute "Resource" to the XData schema.