2017

Table Of Contents
USING QUARKXPRESS SERVER
168 | A Guide to QuarkXPress Server 2017
client Server Configuration dialog box.
Cannot find required
volume or folder
HTTP Error #500QuarkXPress Server Error
#120This alert displays if you attempt to upload
a document that is in a subfolder that does not
exist in the document pool while Generate
Hierarchy on Document Upload is unchecked in
the Server Configuration dialog box. What to do:
C
heck Generate Hierarchy on Document Upload
in the Server Configuration dialog box.
Logs See “Understanding logging.”
Example GET URL
To post a binary file in the root
folder:http://localhost:8080/addfile/abc.qxpTo post a binary file in a
subfolder:http://localhost:8080/addfile/sub1/abc.qxp
Example, object model
Request object name: AddFileRequest // STEP 1 (COMMON FOR ALL
REQUESTS): com.quark.qxpsm.QRequestContext rc = new
com.quark.qxpsm.QRequestContext();
if(!this.DocumentSettings1.documentName.Text.Equals(“”))
rc.documentName = this.DocumentSettings1.documentName.Text;
Stream theStream = uplTheFile.PostedFile.InputStream; long length =
theStream.Length; Byte[] Buffer = new Byte[length]; const int
BUFFER_SIZE = 10000; int nBytesRead = 0,iCount = 0; long
remainingBytes = length — BUFFER_SIZE; if(remainingBytes >
BUFFER_SIZE) { nBytesRead = theStream.Read( Buffer,iCount *
BUFFER_SIZE,BUFFER_SIZE); while(0 != nBytesRead) { iCount++;
remainingBytes = length — (iCount * BUFFER_SIZE); if(remainingBytes
> BUFFER_SIZE) nBytesRead = theStream.Read( Buffer,iCount *
BUFFER_SIZE,BUFFER_SIZE); else { nBytesRead = theStream.Read(
Buffer,iCount * BUFFER_SIZE,(int)remainingBytes); break; } } } else
nBytesRead = theStream.Read( Buffer,iCount *
BUFFER_SIZE,(int)remainingBytes); AddFileRequest addfilereq = new
AddFileRequest(); addfilereq.fileData = Buffer; rc.request = addfilereq; //
Create the service and call it with QRequestContext object RequestService
svc = new RequestService(); QContentData qc = svc.processRequest(rc);
The object model uses SOAP to transfer data, and SOAP encoding is not
the most efficient way to transfer binary data. If you have to add a file
using QuarkXPress Server Manager, the best way is to use a POST request
in a QuarkXPress Server Manager URL. You might use QuarkXPress
Manager to add a file if you wanted to add the file to all registered
QuarkXPress Server instances at one time (assuming the instances are not
sharing a single document pool).For more information, see the
“AddFileRequest” .NET, Java, and Objective-C samples in the QuarkXPress
Server Manager SDK samples.
Notes
The following is a sample of a POST request HTML form.<HTML>
<HEAD><TITLE>Test Addfile</TITLE></HEAD> <BODY> File will always
be uploaded with name new.qxp <FORM
ACTION=”http://localhost:8080/addfile/new.qxp” METHOD = “post”
ENCTYPE=”multipart/form-data”> Please select the file you want to
upload: <INPUT TYPE=file NAME=”uploadFile”><br><br> <INPUT
TYPE=submit VALUE=”Submit”> </FORM> </BODY> </HTML>