Skip to main content

Posts

SFTP and File Upload in SFTP using C# and Tamir. SShSharp

The right choice of SFTP Server for Windows OS Follow the following steps, 1. Download the server version from here . The application is here 2. Provide the Username, password and root path, i.e. the ftp destination. 3. The screen shot is given below for reference. 4. Now download the CoreFTP client from this link 5. The client settings will be as in this screen shot: 6. Now the code to upload files via SFTP will be as follows. //ip of the local machine and the username and password along with the file to be uploaded via SFTP. FileUploadUsingSftp("172.24.120.87", "ftpserveruser", "123456", @"D:\", @"Web.config"); private static void FileUploadUsingSftp(string FtpAddress, string FtpUserName, string FtpPassword, string FilePath, string FileName) { Sftp sftp = null; try { // Create instance for Sftp to upload given files using given credentials sf

using the Id property in JSON objects

When using the `Id` as a property in the Javascript Objects, and sending them using JSON.stringify, they are not model bound as `Id`, instead, they are skipped and inserted as null in the bound model in the controller. Hence, Never Use `Id` as a property for a JSON object.

Credits Deducted for Any Reply to Dirty Dozen Topic

We would like to charge credits for ANY reply to a Dirty Dozen topic regardless of whether an avatar is used or not.  We would like to charge two (2) credits per reply, but if they would like an avatar it will still cost them an additional four (4) credits. to indicate the user that he has insufficient credits to make a post, we use the following code in the file : /home/webmaster/public_html/mod/groups/actions/forums/addpost.php [code] /* ds start - 11.02.2010 -> to check for the user credits */ $avid = intval(get_input('cavid')); $user = get_loggedin_user(); if($user["credits"] < $avCost) {     register_error(elgg_echo("You have insufficient Credits to make a post. Please purchase Credits"),"errors");     forward("http://dirtdisser.com/mod/cubet_membership/upgradecredits.php"); } else if($user["credits"] > $avCost) {     if($avid > 0)     {         $avCost = $avCost * 6;     }     else     {

admin manageable Front Page Message

On the frontpage there is a chat box with text in it (divider id #frontpage-message).  We would like to make this dynamic so any admin can change that text on a page in the Administration section.  Please be sure to limit the amount of characters a user can input so it does not allow enough text to overflow from the chatbox. to write the page title and set the url [code] else if($type=='CHM') {     $external_page_title = elgg_echo('expages:CHM'); } [/code] code to generate the form for handling the messages [code] /* ds start - CHM */ if($type=="CHM") {     $msg = "Edit the Frontpage welcome Message here. <br /><br />";         $chatMessageForm = <<<EOT         <form method="post" action="">             <label for="chatMsg">                 Customize the Front Page Chat Message Here. [Max : 50 characters]             </label>             <textarea id="

hide the reply option for all the commented wireposts in the "thewire posts"

This option is implemented by checking whether the comment text has a @ and if so, we just indent it and hide the reply link from the user so that this comment cannot be commented. /home/webmaster/public_html/mod/thewire/views/default/object/thewire.php 1. check for the @ in the text [code]     $haystack= $vars['entity']->description;     $needle = "@";     if($haystack[0] == $needle)         $shallIndent = TRUE;     else         $shallIndent = FALSE; [/code] 2. use the indentation for the div which is a comment or a reply to a post made earlier. [code]  if($shallIndent)     {         ?> <!-- style="margin-left:50px"--> <div class="thewire-singlepage"  style="margin-left:50px"> <?php } else { ?> <div class="thewire-singlepage">     <?php } ?> [/code] 3. code to display the link only when the user is logged in and when this post is not indented. [code] <