Problem with uploading presentation file (ppt/pps) to Zoho Show with HttpWebRequest in .NET

Problem with uploading presentation file (ppt/pps) to Zoho Show with HttpWebRequest in .NET


I try to upload ppt/pps file from my website, and it work well, but when I use HttpWebRequest object (.NET) to upload and get the response, it crashs.
 
My code:
 

public

static void Upload( string username, string password, string apiKey, string filePath)

{

var ticket = GetTicket(username, password);

if ( string .IsNullOrEmpty(ticket)) return ;

var requestUrl = "http://show.zoho.com/api/private/xml/uploadpresentation?apikey=" +

apiKey +

"&ticket=" + ticket;

var request = ( HttpWebRequest ) WebRequest .Create(requestUrl);

request.Method =

"POST" ;

//request.Headers = new WebHeaderCollection();

//request.Headers.Add("Accept", "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-shockwave-flash, */*");

string boundary = "-----------------------------" + DateTime .Now.Ticks.ToString( "x" );

//string boundary = "------" + Guid.NewGuid().ToString().Replace("-", "");

request.ContentType =

"multipart/form-data; boundary=" + boundary;

request.KeepAlive =

true ;

request.Credentials =

CredentialCache .DefaultCredentials;

var postDataStream = new MemoryStream ();

const string newLine = "\r\n" ;

var streamWriter = new StreamWriter (postDataStream);

streamWriter.Write(boundary + newLine);

streamWriter.Write(

"Content-Disposition: form-data; name=\"content\"; filename=\"" + ( new FileInfo (filePath)).Name + "\"" + newLine);

streamWriter.Write(

"Content-Type: application/vnd.ms-powerpoint" + newLine + newLine);

streamWriter.Flush();

var fileContent = ( new FileInfo (filePath)).OpenText().ReadToEnd();

streamWriter.Write(fileContent);

streamWriter.Write(newLine);

streamWriter.Write(boundary+newLine);

streamWriter.Flush();

streamWriter.Write(

"Content-Disposition: form-data; name=\"submit\"" + newLine + newLine);

streamWriter.Write(

"importpresentation" + newLine);

streamWriter.Write(boundary+

"--" + newLine);

streamWriter.Flush();

request.ContentLength = postDataStream.Length;

using ( var requestStream = request.GetRequestStream())

{

postDataStream.WriteTo(requestStream);

}

streamWriter.Close();

postDataStream.Close();

//var content = new StringBuilder();

//content.AppendLine(boundary);

//content.AppendLine("Content-Disposition: form-data; name=\"content\"; filename=\"" + (new FileInfo(filePath)).Name + "\"");

//content.AppendLine("Content-Type: application/vnd.ms-powerpoint");

//content.AppendLine("");

//var fileContent = (new FileInfo(filePath)).OpenText().ReadToEnd();

//content.AppendLine(fileContent);

//content.AppendLine(boundary);

//content.AppendLine("Content-Disposition: form-data; name=\"submit\"");

//content.AppendLine("");

//content.AppendLine("importpresentation");

//content.AppendLine(boundary + "--");

//Console.WriteLine(content);

//File.WriteAllText(@"e:\a.txt", content.ToString());

//byte[] data = ASCIIEncoding.UTF8.GetBytes(content.ToString());

//request.ContentLength = data.Length;

//var requestStream = request.GetRequestStream();

//requestStream.Write(data, 0, data.Length);

//requestStream.Close();

var response = request.GetResponse();

// Get the stream containing content returned by the server.

var responseStream = response.GetResponseStream();

// Open the stream using a StreamReader for easy access.

var reader = new StreamReader (responseStream);

// Read the content.

var responseFromServer = reader.ReadToEnd();

Console .WriteLine(responseFromServer);

// Display the content.

/// ViewData["content"] = responseFromServer;

//Console.WriteLine(responseFromServer);

// Clean up the streams.

reader.Close();

responseStream.Close();

response.Close();

}

I'm pretty sure that apikey, ticket are correct, the method i use works with other examples, but it doesn't work with Zoho Show Api. Is there any opinion?

    Access your files securely from anywhere









                          Zoho Developer Community




                                                • Desk Community Learning Series


                                                • Digest


                                                • Functions


                                                • Meetups


                                                • Kbase


                                                • Resources


                                                • Glossary


                                                • Desk Marketplace


                                                • MVP Corner


                                                • Word of the Day


                                                • Ask the Experts



                                                          • Sticky Posts

                                                          • Zoho Office Integrator: Moving to the all-new Zoho Sheet

                                                            We introduced the latest version of Zoho Sheet—Sheet 5—in early 2019. This new version consists of a new user interface, improved performance, and an array of useful features. As a part of this, we will upgrade our Remote API integrations to the new version's editor interface on February 29, 2020. Update: The remote API integrations upgrade to the new version's interface will be done on April 15, 2020. Here are some exciting enhancements the new version of Sheet offers for our API users: An AI-powered
                                                          • Businesses prefer Zoho Office Integrator over Microsoft WOPI - Here's why

                                                            Businesses often have difficult decisions to make when building web applications that provide document management capabilities for their users. For example, what's the best solution to integrate with online office editors— Zoho Office Integrator or Microsoft


                                                          Manage your brands on social media



                                                                Zoho TeamInbox Resources



                                                                    Zoho CRM Plus Resources

                                                                      Zoho Books Resources


                                                                        Zoho Subscriptions Resources

                                                                          Zoho Projects Resources


                                                                            Zoho Sprints Resources


                                                                              Qntrl Resources


                                                                                Zoho Creator Resources



                                                                                    Zoho CRM Resources

                                                                                    • CRM Community Learning Series

                                                                                      CRM Community Learning Series


                                                                                    • Kaizen

                                                                                      Kaizen

                                                                                    • Functions

                                                                                      Functions

                                                                                    • Meetups

                                                                                      Meetups

                                                                                    • Kbase

                                                                                      Kbase

                                                                                    • Resources

                                                                                      Resources

                                                                                    • Digest

                                                                                      Digest

                                                                                    • CRM Marketplace

                                                                                      CRM Marketplace

                                                                                    • MVP Corner

                                                                                      MVP Corner







                                                                                        Design. Discuss. Deliver.

                                                                                        Create visually engaging stories with Zoho Show.

                                                                                        Get Started Now


                                                                                          Zoho Show Resources

                                                                                            Zoho Writer

                                                                                            Get Started. Write Away!

                                                                                            Writer is a powerful online word processor, designed for collaborative work.

                                                                                              Zoho CRM コンテンツ






                                                                                                Nederlandse Hulpbronnen


                                                                                                    ご検討中の方




                                                                                                          • Recent Topics

                                                                                                          • [Important announcement] Removal of Zoho Writer's DocuFiller Add-on

                                                                                                            Hi users, Effective 21st Feb. 2025, we will be removing the DocuFiller add-on for Zoho Writer's Fillable Templates. From that point on, the add-on's functionalities, such as sharing or publishing fillable forms for data collection and receiving submissions
                                                                                                          • Send Automated WhatsApp Messages and Leverage the Improved WhatsApp Templates

                                                                                                            Greetings, I hope all of you are doing well. We're excited to announce a major upgrade to Bigin's WhatsApp integration that brings more flexibility, interactivity, and automation to your customer messaging. WhatsApp message automation You can now use
                                                                                                          • Weekly Tips: Manage External Images in Zoho Mail

                                                                                                            When you receive emails every day, whether from clients, newsletters, or services, many of them contain external images that automatically load when you open the message. While this can make emails look more engaging, it can also impact your privacy and
                                                                                                          • Implementing a Self-Invoicing/Vendor Portal in Zoho Creator

                                                                                                            Hello Zoho Community / Creator Experts, We would like to build a Self-Invoicing Portal (Vendor Portal) in Zoho Creator for our external contractors. Our goal is to allow approved contractors to log in, submit their invoice details (hours worked, project
                                                                                                          • Resizing a Record Template Background Inage

                                                                                                            Hi everyone, I have an issue which I can't seem to resolve: Basically, I'm designing a record template in certificate form. I've specified A5 landscape. I've set my background image the same dimensions with total pixels at 443,520. Whatever I try, when
                                                                                                          • Function #32: Schedule low stock notifications on a timely basis to specific users of the organization

                                                                                                            Hello everyone and welcome back to our series! For a business that heavily relies on inventory, monitoring the stock levels and getting timely notifications of low stock items will ensure a smooth sail. Zoho Books allows you to always keep a check on
                                                                                                          • Desk Field Not Showing in Analytics

                                                                                                            Hi there, I recently added a field to our Zoho Desk Ticket Information. I went and added the data retrospectively to the tickets. It is also marked as required, so all new tickets cannot be closed off without it being filled in. When I try to run a report
                                                                                                          • Is it really true that I can't set the default 'deposit to' account in 2025?

                                                                                                            I've been using Books for 7 years and the default account has never been a problem. I usually manually reconcile invoices and have never had a thought about which account. It has always been my account. However, I recently noticed that for the past 4
                                                                                                          • SINCH HUB MESSAGEMEDIA with ZOHO DESK

                                                                                                            1) what I need from MessageMedia, 2) what I want to confirm on the Zoho Desk Dev Forum. MessageMedia – needs and requirements Goal: Send SMS from a Zoho Desk widget for EU users. Auth: HTTP Basic (API Key + Secret). Keys must not live in the browser.
                                                                                                          • Function #46: Auto-Calculate Sales Margin on a Quote

                                                                                                            Welcome back everyone! Last week's function was about displaying the discount amount in words. This week, it's going to be about automatically calculating the sales margin for a particular quote, sales order or an invoice. Business scenario Where there is sales, there's also evaluation and competition between sales reps. A healthy rivalry helps to better motivate your employees to do smart work and close deals faster and more efficiently. But how does a sales rep get evaluated? 90% of the time, it's
                                                                                                          • Invalid URL error when embedded sending url into iframe for my website when using in another region

                                                                                                            Hi team, My site is currently working on integrating your signature feature as part of the system functionality, it's working great but recently there's been a problem like this: After successfully creating the document, i will embed a sending url into
                                                                                                          • 2024 Email Authentication Standards: Elevating Security with Google and Yahoo

                                                                                                            In contemporary email communication, email authentication plays a pivotal role in mitigating email fraud, spam, and phishing attacks. Brace yourself for a new level of security. Starting February 2024, Gmail and Yahoo will be implementing robust email
                                                                                                          • New features released: Data from Picture for Web, Pattern Fill, and Translation in Zoho Sheet!

                                                                                                            Hello Sheet users, In 2024, the Zoho Sheet team focused on research and development to bring new features that add to functionalities like productivity, data management, collaboration, and more. This year, we're all set to roll them out incrementally
                                                                                                          • Add Custom Field Inside Parts Section

                                                                                                            How to Add Custom Field Inside Parts Section in Workorder like Category and Sub- Category
                                                                                                          • Kaizen #59 - Creating alerts and custom messages using Client Script

                                                                                                            Hello everyone! We are happy to resume our Zoho CRM Developer Community series - The Kaizen series! Welcome back to the new start of Kaizen! This post is about Client Script and its simple use cases involving ZDK Client functions. What is Client Script?
                                                                                                          • [Webinar] Zoho Writer for content creators and publishing houses

                                                                                                            Managing multiple drafts, edits, and client reviews doesn't have to slow you down. Join our upcoming webinar to see how Zoho Writer helps content creators and publishing houses create, edit, and publish seamlessly—all in one place. You'll learn how to:
                                                                                                          • Universal search

                                                                                                            Hi, it would be useful if the search bar was universal-so if you entered a term, it would bring up results from contacts, candidates, clients etc all at the same time (but broken down under the relevant headings)
                                                                                                          • Attachment reminder?

                                                                                                            My team and I often need to attach files to our messages, e.g. an explanatory screenshot or a shipping label. More often that I want to admit I mention the attachment but forget to actually attach it. Some email clients have a check-for-missing-attachments
                                                                                                          • New Customization options in the module builder: Quick Create and Detail view

                                                                                                            Hello everyone, We have introduced two new components to the module builder: Quick create and Detail view. The Quick Create Component It is a mini form used to create a record and associate it to the parent record from a lookup field. For example, if you have a Deals lookup in the Contacts module, then you can associate existing deals or create a deal and associate it with the contact. You can customize this Quick Create form by adding standard as well as custom fields. There is no limit to the number
                                                                                                          • Calendar not working

                                                                                                            Are we the only ones. On any browser we cannot click on any of our calendar appointments and get them to open. They just make the browser loop. WE have reached out and have been told they are working on it. The office staff are really stuck. The point
                                                                                                          • ZIA in Zoho Cliq

                                                                                                            Is It possible to use the ZIA feature from Zoho Analytics in the Zoho Cliq?
                                                                                                          • Automating CRM backup storage?

                                                                                                            Hi there, We've recently set up automatic backups for our Zoho CRM account. We were hoping that the backup functionality would not require any manual work on our end, but it seems that we are always required to download the backups ourselves, store them,
                                                                                                          • Multiple upload field CRM

                                                                                                            I desperately need the functionality to add more than one upload field to web to contacts form. How can I do this?
                                                                                                          • Good news! Calendar in Zoho CRM gets a face lift

                                                                                                            Dear Customers, We are delighted to unveil the revamped calendar UI in Zoho CRM. With a complete visual overhaul aligned with CRM for Everyone, the calendar now offers a more intuitive and flexible scheduling experience. What’s new? Distinguish activities
                                                                                                          • Critical Need for Global Search in Zoho FSM

                                                                                                            Hello Zoho FSM Team, We are currently in the process of deciding whether to fully transition to Zoho FSM for managing our field service operations. At present, our team actively uses Zoho Desk (with over 50 users) and Service Fusion, which we are considering
                                                                                                          • Collections Management: # 1 Payment Collection is All About Convenience

                                                                                                            "Sir, can you come tomorrow? My manager wasn't available for the cheque sign-off", the customer said, avoiding eye contact. Ravi forced a polite smile, but inside, he felt a sense of defeat. He had already visited the customer's office twice in the last
                                                                                                          • Can the Product Image on the Quote Template be enlarged

                                                                                                            Hello, I am editing the Quote Template and added ${Products.Product Image} to the line item and the image comes up but it is very tiny. Is there anyway that you can resize this to be larger? Any help would be great! Thanks
                                                                                                          • Deleting Fields in CRM Deletes Views in Analytics

                                                                                                            Hey friends! I'm having some issues when we modify some fields within ZohoCRM. There are times where we need to sunset a field and eventually completely remove it. In these instances, it seems like a lot of views are removed in Analytics. This ranges
                                                                                                          • Updating custom fields in Zoho Projects

                                                                                                            Hi I am wondering if anyone has experience with custom fields in Zoho Projects. I am struggling to update the field using either deluge or the api endpoint. My code is: //custom_Map = map(); custom_Map = {"UDF_DOUBLE_1":"0.27"}; update_Map = map(); update_Map.put("custom_fields",custom_Map.toList());
                                                                                                          • Audio/video quality issues with Zoho Meeting – Any roadmap for improvement?

                                                                                                            Hi Zoho Team, We’ve been using Zoho Meeting for both internal and external meetings, and unfortunately, the experience has been consistently poor. The video and audio quality are so unreliable that it often renders meetings ineffective—especially with
                                                                                                          • Pin multiple columns and adjust column widths in CRM subforms

                                                                                                            Hello all, Subforms act as secondary forms or tables in which you can associate multiple line items to a primary record and thereby ensure more structured and comprehensive data organization. We've made some recent enhancements to subforms. Here's what's
                                                                                                          • Paste issues in ZOHO crm notes

                                                                                                            Hi, since a week or so I have issues with the paste function in ZOHO CRM. I use "notes" to copy paste texts from Outlook emails and since a week or so, the pasting doesnt function as it should: some text just disappears and it gives a lot of empty lines/enters.....
                                                                                                          • Cash based businesses cannot use the new fixed asset module

                                                                                                            Hello all, If your bookkeeping is reporting in cash, you cannot use the new fixed acid module, as it does all the depreciation bookings accrual and not cash. This is definitive and you can't turn them into a cash booking. They will never appear in your
                                                                                                          • Zoho Learn & Zoho Connect

                                                                                                            Hi, Is there a way to sync the knowledge base we have in Zoho Learn with the manuals section is Zoho Connect? Thanks,
                                                                                                          • Modifying iframe data of Zoho booking iframe

                                                                                                            Hello, I have integrated a Zoho Bookings embedded iframe into my website. Currently, I am pre-filling the booking form with default values as part of our process flow. However, I want to ensure that if an input field is already populated with a default
                                                                                                          • Apply Payment Received Amount Zoho Books Invoice

                                                                                                            Hello team here is the sample code How can apply the payment received record over a unpaid zoho books invoice. //......................... paymentID = customer_payment.get("payment_id"); organizationID = organization.get("organization_id"); paymentmaplist
                                                                                                          • Enhance Sign CRM integration

                                                                                                            Hello all, I'm working on a custom Deluge script to enhance the integration between Zoho CRM and Sign by using a writer merge template for additional flexibility. I want to replicate the post-sign document integration that exists between CRM and Sign
                                                                                                          • Zoho Books Finance Modules Not Accessible in Zoho CRM Mobile App

                                                                                                            We have integrated Zoho CRM with Zoho Books using the Zoho Finance Suite integration. In the CRM web version, we can see the Finance modules (Estimates/Quotes, Invoices, Sales Orders, Items, Payments) and are able to create invoices and quotes directly
                                                                                                          • Does Zoho offer a full WhatsApp Marketing Platform (like WATI / GallaBox)?

                                                                                                            lm exploring WhatsApp marketing and I’d like to understand what options are available within the Zoho ecosystem. Currently, I see: Zoho SalesIQ has a broadcast option, but it seems very limited — for example, it doesn’t support uploading contacts via
                                                                                                          • Cliq iOS can't see shared screen

                                                                                                            Hello, I had this morning a video call with a colleague. She is using Cliq Desktop MacOS and wanted to share her screen with me. I'm on iPad. I noticed, while she shared her screen, I could only see her video, but not the shared screen... Does Cliq iOS is able to display shared screen, or is it somewhere else to be found ? Regards
                                                                                                          • Next Page