Click here to Skip to main content
15,906,574 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to Compress the File from File Upload Control and Copy to FTP server and also Decompress that file From FTP server and show as PDF in the browser.Is there any solution for this? i tried lot in google, but all results shows to save file in the Local Machine.

What I have tried:

i tried lot in google, but all results shows to save file in the Local Machine.
Updated 27-Feb-17 8:27am
ZurdoDev 27-Feb-17 14:17pm    
So, take the example that you have that saves to a local machine and change that part to save to ftp server.
Robymon 27-Feb-17 14:22pm    
i did that part, but don't know how to decompress from FTP folder and display that document in the browser.
Karthik_Mahalingam 27-Feb-17 21:35pm    
Always use  Reply  button, to post Comments/query to the user, so that the user gets notified and responds to your text.

1 solution

You're going to need a javascript component, like JSZip, to compress the file on the client side before your client-side code can upload the file to the FTP server.

Once there, I'd probably have a service running that checks that upload folder for ZIP files. Once there, this service would have to move the file to a pre-stage folder, unzip the content to a target staging folder, verify the content for good content if applicable, move it to an appropriate production folder and clear out the staging and pre-staging folders, then notify the web site that the content is ready.

But that's just me.

You could skip the FTP server entirely and just upload the zipped file directly to the web server and do all the steps above synchronously and return the unzipped PDF or some error but if the file is big enough the client may just time out before you send the first byte of your response back to the client.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900