

Joe Sansalone
Members-
Content Count
107 -
Joined
-
Last visited
Everything posted by Joe Sansalone
-
Multipart/form-data vs x-www-form-urlencoded (Indy HTTP server)
Joe Sansalone posted a topic in Network, Cloud and Web
Hi, I have a Indy HTTP server application. Currently receiving requests in the format: application/x-www-form-urlencoded. (everything works fine, I use the parsed params). I'm now also receiving Posts from SendGrid: "the post will be multipart/form-data with the email content URL encoded, but the attachments will be in multipart/form-data". Using the TIdHTTPRequestInfo.PostStream, I'm able to view the payload that they are sending me. 1. Do I need to URLDecode the email content or is it already decoded? 2. Are there any functions/classes to help parse the form-data? it looks like this: --XYzZY Content-Disposition: form-data; name="from" Joe S. <joes1234@gmail.com> --XYzZY Content-Disposition: form-data; name="text" Hello, I'm testing this email. Joe --XYzZY Content-Disposition: form-data; name="to" mb12345@parsetest.projectone.ca --XYzZY Content-Disposition: form-data; name="subject" Subject123 -
Delphi (via Parallels) - blurry fonts on 27 inch monitor
Joe Sansalone posted a topic in Delphi IDE and APIs
Hi, I'm using Delphi 12 on a MacBook via Parallels (running Windows 11 ARM). It looks good on the 14 inch Retina MacBook display. But, when I connect to a 27 inch Dell monitor, the fonts look blurry. Anyone in this situation, what can be done? AND how to save settings so that I can swap between External monitor and macbook? thanks, Joe -
Delphi (via Parallels) - blurry fonts on 27 inch monitor
Joe Sansalone replied to Joe Sansalone's topic in Delphi IDE and APIs
The Parallels "Best for external displays" does work. I showed someone, and they saw the same clearness with Light mode and Dark mode. It's my eyes on the Dark mode - I saw some "double" that made it look blurry .. but it's totally crisp as the Light mode. When I increase font size even a little (code editor) it looks super sharp. When it was set to "Retina Display" but had external monitor, there was a real blurriness because the resolution and scale (windows) were not using the native setting of the monitor. -
Delphi (via Parallels) - blurry fonts on 27 inch monitor
Joe Sansalone replied to Joe Sansalone's topic in Delphi IDE and APIs
Both full screen mode and "unity" produce the same effect. The Parallels setting "Best for external displays", did produce better results ... but dark mode doesn't seem as crisp. I will take a screenshot later today (currently working day job, monitor is connected to work windows laptop) -
Delphi (via Parallels) - blurry fonts on 27 inch monitor
Joe Sansalone replied to Joe Sansalone's topic in Delphi IDE and APIs
Hi Patrick, I installed the driver in windows. For some reason Parallels uses its own driver and it sets color to 8-bit. I changed the setting in Parallels to use "External display" graphics and it helps. Also, I noticed that in Light mode (Delphi IDE), the fonts are crisp and sharp. But, in dark mode, it's a little more blurry. My external monitor is not 4K .. it's 2560 x 1440. Seems like the color at 8-bits is not enough to make Dark mode look crisp. (I made sure to allocate 16GB to Parallels VM, hoping it would change display to at least 16-bit color). Thanks for the suggestions. -
Hi, I'm looking to use InApp purchase in an iOS and Android app created with Delphi. According to ChatGPT, the code below will work and also work with for a subscription based purchase. IS THIS CORRECT? uses FMX.InAppPurchase; var InAppPurchase: TInAppPurchase; ProductIdentifier: string; begin InAppPurchase := TInAppPurchase.Create; try // Set up the product identifier for the consumable IAP ProductIdentifier := 'com.yourcompany.yourproduct.consumable'; // <-- if subscription, 'com.yourcompany.yourproduct.subscription'; // Request product information from the App Store InAppPurchase.RequestProductInfo(ProductIdentifier); // Wait for the product information to be returned while not InAppPurchase.ProductInfoReceived do begin Application.ProcessMessages; Sleep(100); end; // Check if the product is valid and available for purchase if InAppPurchase.ProductValid then begin // Show the purchase dialog to the user InAppPurchase.PurchaseProduct(ProductIdentifier); // Wait for the purchase to complete while not InAppPurchase.PurchaseComplete do begin Application.ProcessMessages; Sleep(100); end; // Check if the purchase was successful if InAppPurchase.PurchaseSuccess then begin // Grant the user access to the purchased content // or Add the item to the user inventory or do whatever you want after the purchase end else ShowMessage('Purchase failed'); end else ShowMessage('Product not available'); finally InAppPurchase.Free; end; end; Joe
-
Hi, I'm running Delphi 12.1 connected to macOS 14.5 with Xcode 15.4. SDK iOS 17.5 I tried a simple app - compiling with Simulator ... launches simulator, app starts but never gets to form screen. I don't need a certificate for Simulator, right? Anybody get Simulator to work? Same simple app ... couldn't get it to run on my iPhone (17.5). (although I think I need to download a developer certificate and provisioning profile .. I thought it would keep from previous Xcode). Joe
-
Thanks Dave! Works for me.
-
Hi, I know that Interbase works on the same machine with my Delphi IDE, for development purposes. Do I need a separate dev license to try Interbase on a machine without the Delphi IDE? If so, do I already have it because I purchased Delphi OR do I need to request it? Joe
-
Anything in real production I purchase a license. But I'd like to play around with new Change Views - got me thinking I should setup something with latest IB version.
-
Like a regular batch file? Does your client application automatically re-connect? Or do you also restart your client app too?
-
Does it mean that existing connections continue to work after 48 hours?
-
Hi, Has anyone used in-app for subscriptions? A client needs me to have the app free for a couple of weeks and then prompt to purchase subscription (in-app). Is this doable with TInAppPurchase? if so, any examples out there? Joe
-
Thanks. I have 11.3 and soon to start using 12.1. (any reason why these changes are NOT yet implemented in recent versions?) I'll check out the code changes by Chris Pim - thanks!
-
Hi, I have Delphi 11.3 and Delphi 12.1 on the same machine. Interbase2020 Update 4 was there before 12.1. Now there is Update 5 as well. But even though I change the shortcut to point to IBMgr.exe gds_db in the Delphi 12.1 directory, the server running shows the old Update 4. I made changes to the registry ... I don't know why update 4 is running?? If I check the location of the running IBServer.exe in task manager it always shows 22.0 folder (Delphi 11.3).
-
installed Interbase2020 Update 5 but always starts 4
Joe Sansalone replied to Joe Sansalone's topic in Databases
gds_db (port 3050) developer_ib2020 (port 3054) I stopped the services so that none are running. I think IbMgr.exe probably is calling the wrong ib_guard.exe or something. I'll probably remove Update 4 files so that there's only Update 5 Interbase. -
installed Interbase2020 Update 5 but always starts 4
Joe Sansalone replied to Joe Sansalone's topic in Databases
using as a server -
(Currently trying with updated openssl DLL files to see if it fixes the problem .. although I need to wait a while to know for sure) In the meantime ... Hi, When testing a Indy Server application everything was fine. Now in production, it stops responding to requests after a while. Is it ok to bind multiple ports like this? (should bind to the same default IP, right?) if not FServer.Active then begin FServer.Bindings.Clear; FServer.Bindings.Add.Port := 443; FServer.DefaultPort := StrToInt(EditPort.Text); FServer.Bindings.Add.Port := 80; FServer.Bindings.Add.Port := 8080; // for testing FServer.Active := True; end; Another question: If an exception occurs in the OnCommandGet of the server and is not handled, would this screw things up for Indy HTTP server? Am I fine as long as I set this before end of OnCommandGet? AResponseInfo.ResponseNo := 200; AResponseInfo.ContentText := 'OK'; // or whatever appropriate response here AResponseInfo.ContentType := 'text/html;charset="UTF-8"'; What else could I be doing to get IdHTTPServer to stop responding to requests? Thanks, Joe
-
Multipart/form-data vs x-www-form-urlencoded (Indy HTTP server)
Joe Sansalone replied to Joe Sansalone's topic in Network, Cloud and Web
Thank you for the code. I realize that I was doing a quick "custom" version just for text and utf8. (and boundary was the same string always coming from SendGrid). It was my attempt to get something working (my application simply needed some Form-data fields coming in). We are lucky to have you in this forum! I'll try out your code. Thanks. -
Multipart/form-data vs x-www-form-urlencoded (Indy HTTP server)
Joe Sansalone replied to Joe Sansalone's topic in Network, Cloud and Web
I'm simply doing a aRequestInfo.PostStream.Position := 0; StringList.LoadFromStream(aRequestInfo.POstStream, TEncoding.UTF8); to get the content into a string list. Then, I'll be looping through each line of the stringlist looking for Content-Disposition: form-data; name="xxx" and getting the NAME of the parameter (i.e. xxx). Then skipping a line and taking every line until --XYzZY, to get the VALUE of the name parameter. I think it will work for anything without attachments. -
trying to POST multiple values of same parameter
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
OK, I got it to work via: tempBody := 'Param1=' + value1 + '&' + 'Param2=' + value2 + '&' ... etc; // build the parameters with & in-between each parameter RestRequest.Params.AddItem('Body1234', tempBody, pkREQUESTBODY, [poDoNotEncode]); // notice that there needs to be a unique name even for the entire body of parameters. -
I'm trying to add the same parameter name multiple times with different values (using POST). It seems like separating values via semi-colon ; and using poFlatArray only works for a GET request. FRestRequest.Params.AddItem('MediaUrl', values , TRestRequestParameterKind.pkGETorPOST, [poFlatArray]); Simply doing multiple AddItem erases previous entry if the parameter name is the same. So, How do I add the same parameter multiple times?
-
trying to POST multiple values of same parameter
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
I understand. BUT, I need: MediaUrl=value1&MediaUrl=value2&MediaUrl=value3 same parameter multiple times. -
trying to POST multiple values of same parameter
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
I tried and it's not working. Is there a way to output the HTTP request text? The actual text that is being sent for the whole request? -
trying to POST multiple values of same parameter
Joe Sansalone replied to Joe Sansalone's topic in Cross-platform
ok, I'll try the parameterless AddItem function ... thanks.