15

How do I save a file in the top-level folder?

 4 years ago
source link: https://www.codesd.com/item/how-do-i-save-a-file-in-the-top-level-folder.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

How do I save a file in the top-level folder?

advertisements

the structure of folders in server look like this:

  • www.example.com
    • images
    • web file
      • here all the files for web
      • index.html
      • example.html

My code is inside web file folder. To save files inside the web file i can useserver.MapPath("~\\folder").
But how to save file to images folder which is located in upper level and same lvl as web file under www.example.com?

New learner, please guide..


how about?

server.MapPath("~/images/myfile.jpg");

Related Articles

ASP.NET MVC Routing to serve a file at the top level of the site?

I'm an absolute beginner with ASP.NET[MVC] so this is probably a dumb question. I want to wire-up a url "http://localhost/clientaccesspolicy.xml" to a specific controller action. How could I go about doing this? I'm also wondering how to just st

Java gets the top-level folder of the zip file

I kind of stuck in this problem. I want to print only the top level directory from a zip file. For example I have a zip file with following structure: Sample.zip - sound - game -start.wav -end.wav - Intro - custom - Scene - fight - Angle ............

Copy files from the top-level subfolder only to another location

I want to copy all files in only second level subfolders to another location. All file names are unique. The second level subfolders in this example are 01102009, 05302009, and 09012010. Example: C:\test\ 2009\ 01102009\ file123.A09 file567.B07 05302

How do I save a file using the name of the response header with cURL

This question relates to the command line version of cURL. I'm trying to download a file from a cgi script. http://someserver/perl/dl.pl?ID=2 Using a browser the filename comes up as 'remotefilename.gz' cURL wants to save the file as 'dl.pl?ID=2' How

How to start reading a file at the top of python?

I am trying to add dependencies from a list to a requirements.txt file depending on the platform the software is going to run. So I wrote the following code: if platform.system() == 'Windows': # Add windows only requirements platform_specific_req = [

How to include a PHP file at the site level using .HTACCESS or other methods

I want to include my PHP file googleanayltics.php on every page on my webserver that is a .php or .html document I would like to know: A) How do I add this right BEFORE the </head> tag B) How do I add right right AFTER the <body> tag I'd like

How to write a simple C # script to copy the file to the top-level directory?

Trying to write a simple C# script to copy file to directory one level up. Here is what I have, but it is sending an error, "Script.OnActivate()" not all code paths return a value. and my code: using System; using System.Collections.Generic; usi

Select in the top level folder

So, I've created a website and I have lots of pages in the public_html folder. Those page load the images and script from folders who are direct child of public_html folder. Now I need to move all those files into a folder (let's name it sample-folde

How to save download files outside the Rails application folder?

I wan't to save my uploaded image outside of Rails(3) application. As I'm developing 2 separate application, but those applications are sharing same database. So I need a folder from where I can access images from both application.You can add a symbo

How do I save a variable at the application level in php?

How to save a variable at application level(same for all users) in php which will get updated after some time? I've tried to find about it. I've found the following solutions: Implement using file handling. Cache (Memcache or APC) Implement using Dat

How can I copy a file to the Tomcat Webapp folder via maven?

I want to copy a resource file from src/main/resources to Cargo Tomcat in /target/tomcat6x/container/webapps using Maven. I tried using maven-resources-plugin but am not having any success. I tried this: <plugin> <groupId>org.codehaus.cargo<

How do you include C ++ files from the / Library / Framework folder in MAC

I am trying to use SDL. I have a folder in /Library/Frameworks called SDL2.framework. I want to include the file SDL.h in my project. How do I do this? My code looks like: // Example program: // Using SDL2 to create an application window #include <SD

Requires a file on the top-level directory

Here is my project structure: /app --/lib ----/porter.rb --/spec ----/porter_spec.rb In file porter_spec.rb i have include directive: require '../lib/porter' Now I'm trying to run the test: cd app rspec and get the error: C:/Ruby193/lib/ruby/1.9.1/ru

Powershell gets the top parent folder

My ultimate goal is to get a list of top level folders (for a given path) where a file has been modified in the last day. There are probably a lot of ways to do this. The place where I am having a problem is getting the top level folder only. Here is

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK