IIS 7.0+ HTTP PUT Completes, but No File Saved - http

I'm struggling to figure out what exactly is happening. I am using GdPicture to save a scanned document through java script using their COM+ code and source project as my starting ground. Long story short is their function issues a HTTP PUT command specifying the file name to be saved.
When I execute the command I see that the request is getting to my server, and even has the appropriate content size to include the pdf document. I even get a 200 response back to my browser, no errors or anything...... yet the pdf doesn't get saved. Is that because PUT isn't the right way to do this? I don't have the option to POST the file because the transfer is wrapped in GdPicture's api... so with that said.
I have done the following
Ensured that IIS_IUSRS group has write permissions to the "Upload" virtual directory
Added a handler that specifically allows the PUT verb for "*.pdf"
Removed the StaticFileHandler for the "Upload" virtual directory
I aplogize for the links, but I don't have 10 rep points yet
PUT Request from FIDDLER
Response
** Edit **
More information about GdPicture, I have already contacted them and their function is not the problem. The implementation is as simple as
var status = oGdViewer.SaveDocumentToPDF_2("http://domain.com/Annotation/Upload/" + FileName, "user", "pass");
Thanks!

Related

Why is there an error when submitting the form?

Please tell me how to solve the problem.
The site is on Wordpress, the page has several modals with forms.
They all work well. I need to configure adding an email to the Sendpulse address book, which the user enters into the field.
Installed the sendpulse package via composer: https://github.com/sendpulse/sendpulse-rest-api-php
The situation is this:
In the directory with the theme, there is a functions.php file where there is a form handler, in which you can configure sending letters with requests from forms.
In this file, I added, according to the instructions from github sendpulse, the code for sending an email to the address book:
require '../private/vendor/autoload.php';
use Sendpulse\RestApi\ApiClient;
use Sendpulse\RestApi\Storage\FileStorage;
define('API_USER_ID', 'b7****************************************');
define('API_SECRET', 'e1*************************************');
$SPApiClient = new ApiClient(API_USER_ID, API_SECRET, new FileStorage());
$bookID = '15********';
$emailForSP = ['test6#test.ru'];
$SPApiClient->addEmails($bookID, $emailForSP);
If you just add this piece to the beginning of the file, then it works out and the address is added to the book. But sending letters to mail does not work, an error is thrown: https://hsto.org/webt/v8/qn/le/v8qnled6ibyy-ltp9afwyrjv-2q.jpeg
In the error_log file the line is: https://hsto.org/webt/mk/vo/g0/mkvog03mb7olfji0qrjcsyxktf0.jpeg
Error text from main.js file: https://hsto.org/webt/cd/-n/ry/cd-nryfx06_mvgtglu-t9msp8ga.jpeg
That is, this piece of code somehow affects the processing of the form handler function. In general, I need to trigger sending an email to the book after sending a letter to the mail, but in this case nothing works at all.
I didn't look for the cause of the conflict for a long time. Allocated sending e-mail in the sendpulse into a separate file and added ajax post request to this file. I don’t know why I hadn’t thought of this before.
let emailForSendPulse = $form.find('[name="email"]').val();
$.post('/wp-admin/smth.php', {email: emailForSendPulse}, function(data){
console.log('Form sended');
});

QuickBooks 14 Web Connector (QBWC) Samples

I am very newbie QBWC, I have downloaded sample (WCWebService-ASP.NET(C#)) from QB website and reviewing the "QBWC_proguide", but I am getting an error during add applicaiton in QBWC, that is invalid when I add a qbxml(Add Customer) file.
Unxpected root doc:qbxml
QBWC1051: The new application was not added.
I have couple of questions.
is token ID return from QB? or shall we add and GUID?
I have seen some sample (WCWebservice) - buildRequest, this has CustomerQuery, InvoiceQuery and BillQuery, But I didnt get any reponse(I am doing some mistake here).
Do I need to generate a QWC file for every time to use in QBWC utility to "ADD APPLICATION".
Please advise me to achieve following process basically I am trying to populate Products from QB, and generate order from website again I should update the product count back to QB then Generate a Invoice from Website.
Thanks in advance
Unxpected root doc:qbxml
QBWC1051: The new application was not added.
To troubleshoot the above error, you need to post your .QWC file so that we can see what you're doing.
Here's an example .QWC file:
http://www.consolibyte.com/docs/index.php/QuickBooks_Web_Connector_Overview#Example_.QWC_File
is token ID return from QB? or shall we add and GUID?
You will choose a GUID OwnerID and FileID to put in the .QWC file.
Your web service may also use a GUID for a session token.
I have seen some sample (WCWebservice) - buildRequest, this has CustomerQuery, InvoiceQuery and BillQuery, But I didnt get any reponse(I am doing some mistake here).
The response would come from QuickBooks. Your web service would then parse the response to do something with it.
You can see all available requests and responses by looking in the QuickBooks OSR:
https://developer-static.intuit.com/qbSDK-current/Common/newOSR/index.html
Do I need to generate a QWC file for every time to use in QBWC utility to "ADD APPLICATION".
No. You will generate a .QWC file once for each QuickBooks company file you are connecting. The .QWC file essentially configures the Web Connector, and then after that it's already configured and will use the settings you loaded from the .QWC.

Error downloading

to download a console returns the following error:
Frame load interrupted by policy change
Example:
Start Download
Console Preview:
Should I configure something in the Compiler or QWebSettings?
I discovered.
In conventional Webkit browsers, the place to download the console shows how the request canceled, so before turning to "download manager" of the browser the request should be canceled.
solution:
//replace [QWebView] by your WebView
connect([QWebView]->page(), SIGNAL(unsupportedContent(QNetworkReply*)),
this, SLOT(downloadContent(QNetworkReply*)));
...
void [main class]::downloadContent(QNetworkReply *reply){
//Replace "[main class]" by "Class" having the signs used in WebView.
[QWebView]->stop();
//solution: stop loading --replace [QWebView] by your WebView
/*function to donwload*/
}
Edit: hard to tell without a proper backtrace I requested in the comments, but it looks like the warning might actually be harmless.
Original:
That's because the QWebView doesn't know what to do with your app.exe file -- it's not an HTML page or a text/plain document or a supported image, after all. The QWebView class is not a web browser; you apparently want to start a download of some file, but there's no full-blown download manager in that class. You will have to provide your own code for this -- the code will have to ask for a proper location to save it, etc.
You can start with QWebPage::setLinkDelegationPolicy and handle this particular click yourself.

Error handling in ASHX code

I created an ASHX file and use it to handle async file uploads.
Since the site might not be hosted on our servers, I want to check for write permissions and delete permissions and supply the end user (site content editor in this case) with an error they can deal with.
I'm using uploadify for the upload, I'm not sure, but I`m guessing this complicates the return of a message that can be shown on the page, but maybe not.
I ended up using the c# code in ashx file to check for permissions on the directory and returned different status codes as JSON objects.
context.response.write("{success: 'false', message: '" + ex + "'}")
And in the client side JS I just access response.message if response.success = false.
Everything works well.
Thank you!
Before the user is able to attempt an upload, trying writing and reading a small file to the destination on the server (on the server side), if this fails then you can supply them with an appropriate message.

Reading a remote URL in Domino LotusScript

I have a remote RSS feed which has to be transformed into Notes documents using LotusScript.
I've looked through the documentation, but I can't find how to open a remote URL in order to retrieve its contents. In other words, some sort of wget- or curl-like functionality. Can anyone shed some light on how to do this? Using Java is not an option.
Thanks.
Check out the NotesDOMParser class - available in LotusScript - which lets you (indirectly) pull XML from a remote URL and process in a an XML DOM object.
You can pull the XML into a string using the MSXMLHTTP COM object, then use NotesStream to send the XML to the NotesDOMParser.
I have not tested, but the code would look something like this:
...
Set objXML = CreateObject("Microsoft.XMLHTTP")
objXML.open "GET", sURL, False, "", ""
objXML.send("")
sXMLAsText = Trim$(objXML.responseText)
Set inputStream = session.CreateStream
inputStream.Open (sXMLAsText)
Set domParser=session.CreateDOMParser(inputStream, outputStream)
domParser.Process
...
Documentation: http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=/com.ibm.designer.domino.main.doc/H_NOTESDOMPARSER_CLASS.html
You can't open a remote URL (whether it's HTTP or some other protocol) using native Lotusscript: the object library simply doesn't support it. If you're running on a Windows server, you should be able to use the MS XMLHttp DLLs to get a handle on your remote file via a URL, as specified by the previous answer. (Alternatively, this link specifies how to parse and open a UNC path with Lotusscript—again, Windows only).
All that said, if I understand you correctly, you're not using HTTP to access the remote file at all. If the RSS file is just on a simple path, why can't you open the file for parsing in the normal way with Lotusscript?

Resources