Xml file not getting uploaded fully - c#

In my C#/winforms app, using System.Net's HttpWebRequest class, I programmatically upload an xml file to a server(ABC) outside of our company network.
(App user is located in NY and server is located in UK).
We've not been having any issues with this in last 2 years until yesterday when we found out that the file received by the server is not complete making the xml not well-formed and invalid.
I save the xml on our local server before sending it to ABC.
We notice that the size(36 kb) of the this xml is same what was received by ABC but almost half of the xml received by them is empty with lots of blank spaces and some tags appear broken.
Not sure why this could have happened and how to programmatically resolve this going forward.
Would anyone be able to advise on this please?
Thanks for your help in advance.

Related

Sending Attachment to SAP B1 remote Service Layer

In a C# application, I want to send files to "remote SAP B1 service layer". I have tried many ways to send an attachment to this remote service layer, using their b1s/v1/Attachments2 endpoint, but I continuously receive an error "A file with this name already exists. [Attachments2_Lines.FileName][line: 1], ". Even this file does not exists in the service layer shared directory.
Moreover, I do have the read/write permissions in the destination path.
Any Kind of help will be highly appreciated.
I had a similiar issue when adding attachments to a document. Try to send a GET and retrieve all records for /Attachments2. If the file was added before there might already exist a record having the same filename.
To add it again, you need to call a DELETE on the specific ID first, then POST it again.

pptm file not downloading on IIS 6.0

I have uploaded a .pptm file on windows 2003 server in a website directory folder. I get a link to the file like www.domainname/media/CLT/ResourceUploads/4021161/proposal%20sample.pptm when I type in the link in the browser address bar I get this error
Gateway Timeout Server error - server xx.xxx.xxxx.176 is unreachable at this moment. Please retry the request or contact your adminstrator.
If I change the extension of the same file to .ppt or .pptx then the document downloads fine.
I have also tried a different sample file (available on this link http://greenvsa.wikispaces.com/file/detail/proposal+sample.pptm) but the result is still the same.
Any ideas or any direction I shall look into? thanks

Display image with " " character in url

I have a problem in my MVC 3 Application
i can't access to my image with url like that:
http://virtualDirectoryImage.fr/ImageNameContains+.jpg
or
http://virtualDirectoryImage.fr/ImageNameContains%2b.jpg
I got Error 404 file not found (the file exist, i can access to others images witch dont contains plus (+) symbol).
How can i do plz?
IIS7 issue? Application issue?
PS: the images are not hosted in my application. (Virtual Directory, on the same Server)
thx for your help
Can you follow the steps given in the following url
http://helpx.adobe.com/cq/kb/CannotOpenAFileHavingSpecialCharactersInTheFilenameOnIIS.html
basically IIS will block the file names if it contains any special characters.Esspecially if it contains & in the file name for security reasons.It's a good practice to replace the special characters with "_" while uploading the file to the server

Uploading Files with hash(#) in filename to WebDAV Server

I have files with filename containing # in it (eg: #qwerty.txt, file#1.exe).
I want to upload these files to WebDAV Server, running on Linux.
In ASP.Net, I use HttpUtility.UrlEncode() Method for encoding URL.
But, this removes # from the file-names, to be uploaded and thus uploading fails.
Please reply.
Thanks.
UrlEncode does not remove pound/hash characters but replaces them by %23.
Thus #qwerty.txt becomes %23qwerty.txt. If you use that resulting filename to reference the local file for uploading it will fail to find it.
If you want a more definitive answer you might want to update your question with the code you are using to upload the file.

How to send .zip in attachment by email on exchange server?

Hell guys,
I'm coding in csharp to send an email which contains a .zip file (has htmls and css inside). When I check the mail recieved, In fact, instead of the .zip file, the attachment becomes a txt file and has:
FILE QUARANTINED
The original contents of this file have been replaced with
this message because of its characteristics.
File name: 'xxxxxxx_Result.zip'
Virus name: 'Large uncompressed size'
The exchange server has blocked the zip file..I'm using CDO to create and send the email.
I tried using the code to send a mail with a zip file generated by WINZIP, there was no problem, then I tried using outlook to send a mail with the zip file generated by my code(I use sharpziplib library), the problem occured...
How can I do to send the attachment correctly? Many thanks in advance!
Allen
I encounter similar problems sending email on our network. I've found that using an alternate compression format, such as 7-zip (.7z), is adequate to get my content through the filters. This could resolve the issue if the block is not due strictly to size.
Looks like your mail server or spam service have removed your attachement and replaced it with the txt file, it sounds like your code is fine and you need to speak to an admin regarding the mail filters and send size quotas!
For anyone facing this problem, here is a solution. You have to explicitly set the file size for the zipentry.
ZipEntry newEntry = new ZipEntry(fileName);
newEntry.DateTime = DateTime.Now;
newEntry.Size = fileData.Length; // setting data size

Categories