Code Upload FTP C# – Upload file to server-Full

Just I am  completed my project winform, to working with file excel (over 30MB), i can not process at client, i must upload to server and process data.

I would like to share the following with you code upload to server

  • ftpServerIP: address to server 192.168.2.36
  • ftpUserID: Username to access server
  • ftpPassword: password ftp
  • pathFilename: path file at client (ex: E:\xxx12.xls)
private bool UploadFTP(string ftpServerIP, string ftpUserID, string ftpPassword, string pathFilename)
        {
            try
            {
                FileInfo fileInf = new FileInfo(pathFilename);
                string uri = "ftp://" + ftpServerIP + "/" + fileInf.Name;
                FtpWebRequest reqFTP;
 
                // Create FtpWebRequest object from the Uri provided
                reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/" + fileInf.Name));
 
                // Provide the WebPermission Credintials
                reqFTP.Credentials = new NetworkCredential(ftpUserID, ftpPassword);
 
                // By default KeepAlive is true, where the control connection is not closed
                // after a command is executed.
                reqFTP.KeepAlive = false;
 
                // Specify the command to be executed.
                reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
 
                // Specify the data transfer type.
                reqFTP.UseBinary = true;
 
                // Notify the server about the size of the uploaded file
                reqFTP.ContentLength = fileInf.Length;
 
                // The buffer size is set to 2kb
                int buffLength = 2048;
                byte[] buff = new byte[buffLength];
                int contentLen;
 
                // Opens a file stream (System.IO.FileStream) to read the file to be uploaded
                FileStream fs = fileInf.OpenRead();
 
                try
                {
                    // Stream to which the file to be upload is written
                    Stream strm = reqFTP.GetRequestStream();
 
                    // Read from the file stream 2kb at a time
                    contentLen = fs.Read(buff, 0, buffLength);
 
                    // Till Stream content ends
                    while (contentLen != 0)
                    {
                        // Write Content from the file stream to the FTP Upload Stream
                        strm.Write(buff, 0, contentLen);
                        contentLen = fs.Read(buff, 0, buffLength);
                    }
 
                    // Close the file stream and the Request Stream
                    strm.Close();
                    fs.Close();
                    return true;
                }
                catch (Exception ex)
                {
                    DevComponents.DotNetBar.MessageBoxEx.Show("Upload Error");
                }
            }
            catch (Exception)
            {
                DevComponents.DotNetBar.MessageBoxEx.Show("Upload To Server Error");
            }
 
            return false;
        }

Easy File Transfer with Files 4 Client Pro-Demo and buy cheap

With Easy File Transfer Files 4 Client Pro:

  • Upload your files directly inside the brower and share them
  • Presents your files and folders in a well-arranged list
  • Slick design available in any color
  • Brand it for your name and logo
  • Drag and drop upload supported
  • Easy and fast in browser setup

Features Easy File Transfer

  • Powerful admin backend
  • Upload your files conveniently from inside the browser
  • Manage your files – view, rename and delete them with ease
  • Have full control over your files as they’re not hosted remotely
  • Send your recipients well-arranged and easy to use lists of files and folders
  • Let your recipients zips all files of a folder for download if requested
  • Automatically deletes old folders after a specified amount of time if wanted to save server space
  • Optional password protection for client links
  • Image thumbnails for maximum convenience
  • Unlimited use of subdirectories within your client links

easy-file-transfer-with-files-4-client-pro-demo-and-buy-cheap

  • Shows a customizable title text (e.g. company name)
  • Leaves space for your logo or other image at the site title
  • Available in any color, just use a color picker to define your base-color.
  • Easy and comfortable in-browser setup, done in a minute!
  • Minimal and elegant design that leaves room for customization
  • HTML5 / CSS3 ready
  • No database required
  • jQuery animations
  • Video Tutorials explaining installation and use in detail!
  • Supported by all major browser and IE6+!

Customer review

  • I love it, I purchase it.
  • Congratz, great great work, I really suggest you make a responsive version too. GLWS
  • Awesome and very functional script, good luck with sales !
  • Doesnt every customer see than ALL files ? Or is it possible to set for every files a password & only the one who logins with this password can see those files?
  • Thank you for your interest in my item! Only users who have the link of your file-folder can see the files. The script doesn’t allow to list all files of all subdirectories you made except for the administrator who has to login to the admin panel. If that doesn’t suffice, you can still password protect every link with individual passwords to make sure that only users with these passwords can see the link.I hope this aswered your questions sufficiently. If not just let me know

Thanks for reading.

How to Customize the Genesis Footer

remove_action('genesis_footer', 'genesis_do_footer');
add_action('genesis_footer', 'eo_custom_footer');
function eo_custom_footer()
{
 echo '<p>';
 echo 'Copyright &copy; ';
 echo '2011 - ';
 echo date('Y');
 echo ' &middot; <a href="http://journeycoder.com">Journey Coder – Sharing To Success</a> &middot; All rights reserved';
 echo '</p></div>';
}

Custom Footer of Genesis, theme geneis

Show image from byte array in .net MVC

1. Code CSharp

To do not show path image, you can encryt base 64 and display

public ActionResult Index()
        {
 
            string path = Server.MapPath("~/images/samsung-galaxy.jpg");
            byte[] imageByteData = System.IO.File.ReadAllBytes(path);
            string imageBase64Data = Convert.ToBase64String(imageByteData);
            string imageDataURL = string.Format("data:image/png;base64,{0}", imageBase64Data);
            ViewBag.ImageData = imageDataURL;
 
            return View();
        }

2. Code HTML:

<img src="@ViewBag.ImageData" />

Happy coding

Download: The Practice – Lawyer, Legal Offices HTML Theme

Download: The Practice - Lawyer, Legal Offices HTML Theme

1. Introduction: WordPress theme The Practice is a responsive, clean and stark looking, lawyer HTML theme specifically designed and developed to meet the needs of attorneys, legal offices, consultancy firms and many others that need a corporate website. With a responsive layout and fluid grid, The Practice handles all devices and screen resolutions with ease. The colors are easy on the eye, and the overall minimalist approach to the design makes for a relaxing and userfriendly experience for your visitors.

2. Features WordPress theme The Practice:

  • Responsive HTML theme (re size the browser to check it out)
  • Huge amount of page templates can be made using the shortcodes HTML pages.
  • Working contact and career forms
  • Cross browser optimization (IE7, IE8, IE9, Firefox, Safari, Opera, Chrome)
  • Premium design
  • Google Web Fonts custom fonts
  • 28 HTML 5 valid files
  • Creative homepage slider
  • 9 Photoshop files used to create the HTML theme

Thanks for reading.

Download: HomeQuest – Real Estate HTML Theme

Download: HomeQuest - Real Estate HTML Theme

Introduction: WordPress theme HomeQuest Built to cater to real estate agencies, brokers and directories. With a responsive layout and fluid grid, HomeQuest  handles all devices and screen resolutions with ease. HomeQuest HTML has a pixel perfect design and a bunch of features that will make clients call again and again. We have also added some handy […]

Continue reading...

Download: Unite Gallery – Multipurpose JQuery Gallery

Download: Unite Gallery - Multipurpose JQuery Gallery

The Unite Gallery is multipurpose javascript gallery based on jquery library. It’s built with a modular technique with a lot of accent of ease of use and customization. It’s very easy to customize the gallery, changing it’s skin via css, and even writing your own theme. Features Unite Gallery – Multipurpose JQuery Gallery: Responsive – […]

Continue reading...

Download: HTML5 Flow Responsive Slider

HTML5 Flow Responsive Slider

1. Intro HTML5 Flow Responsive Slider The HTML5 Flow Responsive Slider has a flexible / fluid / responsive layout, it will adapt it’s size (width and height) based on the parent container (div or some other html tag) and every piece of the gallery will align and position accordingly, this basically mean that it can […]

Continue reading...

Download: jQuery Responsive Google Charts Plugin

download-jquery-responsive-google-charts-plugin

Responsive jQuery Google Charts Plugin Its now easier than ever to use Google charts in your website. No javascript knowledge or jQuery knowledge is required. Just html/javascript. Works anywhere. You can easily set up nice, SVG, responsive charts on your websites by setting a few HTML data- properties. Here’s all the HTML you need to set […]

Continue reading...

Download: jQuery Graphs Plugin

download-jquery-graphs-plugin

Don’t waste time on adjusting width or width and height of bars for your chart. Use this Graph Plugin,Just add data of your columns and Your graph is ready!!! Pack contains Vertical bar graph,Horizontal bar graph,Histogram,Line Graph,Pie Graph,Area Grpah,Donut Graph Individual jquery Plugin and css file for every graph is given for ease. Easy to […]

Continue reading...

Download Pav Digital Store Responsive Opencart Theme

Download Pav Digital Store Responsive Opencart Theme

1. Introduction: Pav Digital Store is A design is really creative, feeling very gentle and delicate are what This Opencart template will bring to your digital store, mobile shop, computer store….. Also this Opencart Template is specially designedD for gitshop , beauty, fashion stores. with black style and great slideshow, banners to make your shop […]

Continue reading...