Upload Folders to Server in C# Asp.net - asp.net

I know how to upload files/images in asp.net using fileuploader control.i want to upload folders not a single file.i want to upload whole asp.net website to another server (may or may not using FTP) using C# Coding.
Even i tried to make a zip and upload but we can not upload zip too....
what is the best way to upload whole DIrectories/Folders/Files to server using c# coding?

You can use of ftpwebclass in C# for uploading a folder using ftp
check out this link

C# has build-in FTPrequest class where you can create folders, upload files, delete files etc.
If you want to upload folders from a webpage, you cannot use this technology in the browser, then you will have to use a rich-client such as Java, Flash or similar plugin.
If you can provide the users with a Windows or Mac client, you can use C# (either .NET or Mono) for the FTP transfer.
ZIP files arent a problem for ASP.net nor C#, but you still only upload 1 file (zip-archive) and then its up to the server to unzip it using eg. C#. Look at 7-Zip which is opensource, then you might get some ideas too.
You could also just try and use the build-in lib for it (compression):
http://www.eggheadcafe.com/community/csharp/2/10050636/how-to-compress-and-decompress-file-in-c.aspx

Related

Is there any way/tools to change a build file into solution file in asp.net, if solution file is misplaced and there is no backup of solution file?

I have a build file of one of my applications deployed on my server.
I lost my laptop, and unfortunately, I had no backup of my solution file.
Now I want to make changes in my application, but I have no solution file of that application.
The application was made on ASP.net web forms.
I think you need a Decompiler like DotPeek which enables you to decompile the dll's and save them as a code projects (c# or vb.net).

TideSDK app to send file to FTP server

I've developped a web page for sending file to a FTP server. It take the file, rename it, access a FTP server, create a directory and put the file in.
I'm looking for a way to make it working as a desktop app. Is TideSDK able to do that? I guess it could as I used PHP, HTML and JQuery. But does the TideSDK API allow to access FTP server?
Thanks!!!
I was asking me the same thing. Using <insert popular search engine name here> I digged up something on the official Github page of TideSDK.
It is possible to compile the TideSDK by yourself to include PHP's support for (in example) FTP in the PHP interpreter. Please refer to the TideSDK wiki pages about compiling TideSDK for other platforms than Linux like given in the example.

Allow users to download files from subversion from a asp.net web application

Is there a way to allow users to download large files from subversion using an asp.net web application. We don't want to give SVN accounts to all web users but want our site be able to serve the files from SVN without downloading the actual file to the server where web application is running. Is there a way this can be acheived?
Any help is greatly appreciated.
Thanks,
Ana
You could foresee one SVN account and write an ASP.NET handler to process the file from the svn server into an in-memory file (DotSVN or something similar) and serve it to the user for download.
You might take a look at Mercurial Large Files Extension as well.
DotSVN
ASP.NET Handlers
Mercurial Large Files Extension

Uploading issues with an asp.net website

I have created my first website using asp.net 3.5 .
I have used App_Code for managing my source code files.
Now, after completion:
List item
What needs to be uploaded to the server ?
Do uploading all file including webforms files, source code files make any sense ?
Please provide your own suggestions apart from these.
You should look in to one of these several very good tutorials and articles about deploying ASP.NET applications.
How to Deploy ASP.NET
15 Seconds: Deploying ASP.NET
Deploying ASP.NET Applications on IIS 6
Deploying ASP.NET Applications
Now to your thoughts on what should be uploaded and what not. If you understand the asp.net cycle and how the files are processed by the webserver, it would be easy to know that all files need to be uploaded. But since this is your first application you probably don't have that knowledge.
So, to save you some reading time, Upload everything. In older versions such as 1.1 you had to compile all your source-code into binaries, which you don't have to anymore, but you can, it's up to you.
I However prefere to upload all the files without compiling it to binaries, makes it easier to manage once they are on the server.
The webserver will upon request ( first request ) compile these and then use the compiled files on other requests, this is the short answer anyway, this is why the load-time is longer the first time and the other times it's ( suppose to ) go faster.
Also, worht to know is that if you change the web.config, the application will re-compile.
So just drag n' drop em' to your webb-location and start playing!
If you are using the App_Code folder, it sounds like you are using a web site project type. In this case, the easiest thing to do is just xCopy all of the files up to the webserver. IIS will then do Just In Time compilation (JIT) the first time a page is hit, and will compile your code on the fly.
rgds,
Paul
All content files (i.e. aspx, ascx, asmx, asax, js, css, htm, jpg, gif, png) and DLLs need to be deployed to the server. I recommend using the Visual Studio "Publish..." option on the Build menu to do this for you. It can deploy to a folder (which you can then copy to somewhere else if you like), an FTP site or to an IIS virtual directory.
Uploading your .cs or .vb files is not necessary. It will still work if you do but it's probably safer not to. There's a remote possibility that IIS will have a vulnerability or a sysadmin will make a mistake and your source code will end up being served to the public.
In Visual Studio you could could do File -> New Web Setup Project and build an MSI to do it. This article and This article have more details on this option.

Making a website/project Portable - Check List

Good evening/morning/after/noon.
I have an ASP.net 3.5 website and I am using vb.net in VWD 2008 Express, I am also using MS SQL Server 2008 Express, I used ajax tabs and a textBox characters counter control developed by https://web.archive.org/web/20211020202742/https://www.4guysfromrolla.com/ The database is attached with MS SQL Server Management Studio Express and the files are stored in the SQL default "Data" folder.
The whole project's code and forms are stored in a folder in my E drive. I need to hand the whole project to another coworker who have to finish it, please describe in steps how can i make my website portable (like i can put it all in a folder that he can carry around in his flash disk).
One more thing, I already finished my side of the project, I need to ship it out to this other programmer.
Can anyone suggest something like a: Checklist or Must Do list to achieve this?
PS: I have had a problem trying to move the project from one server to the other, the project seems to look for the dlls of the AJAX control and the textBox counter where i originally unzipped the folders in which they cam in, which i think was on my desktop, although when i added those controls to the Tools tab, i created a new tab, then i choose the dll from the where i unzipped the controls source code, aint that enough?
Thanks in advance
I use the following folder structure for all my solutions
solution
docs
libs
scripts
sql
src
docs - contains all documentation
libs - contains all non GAC'ed framework dlls that the solution uses. You should copy the dlls in here first then reference them this way they are a relivive reference from the src folder.
scripts - build scripts for designers who don't have VS installed and the build server
sql - all sql scripts for creating your database
src - all source for the solution we break this folder up into the following file/folder structure
solution.sln
project1
project2
website1
website2
etc
Now when you copy the solution folder everything is relative so will work.
I'd advise that you add your project to source control, I'd recommend Subversion/SVN and the TortoiseSVN client

Resources