w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to create a folder then save an image to the created folder using fileuploader in C# asp.net?
Instead of FileUpload2.SaveAs(Server.MapPath(strpath) + filename); try FileUpload2.SaveAs(Path.Combine(strPath, filename)); you already know the physical save path - no need for Server.MapPath

Categories : C#

PHP - Create a folder and save an image to that folder? Then display that photo?
You need to create the directory before you can move files into it. You can use the file_exists function to check on the directory first and then create it of needed: if (!file_exists('path/to/directory')) { mkdir('path/to/directory', 0777, true); } You may prefer other permissions.

Categories : PHP

Can we create a new folder inside a standard deploy folder in JBoss?
You should check your deployment scanner config, which is kept in server/<profile>/conf/jboss-service.xml. The relevant part is: <mbean code="org.jboss.deployment.scanner.URLDeploymentScanner" name="jboss.deployment:type=DeploymentScanner,flavor=URL"> ... <!-- URLs are comma separated and resolve relative to the server home URL unless the given path is absolute. [...] --> <attribute name="URLs"> deploy/ </attribute> ... <!-- Indicates if the scanner should recursively scan directories that contain no "." in their names. [...] --> <attribute name="RecursiveSearch">True</attribute> </mbean>

Categories : Java

Java create a folder in current package folder
Well assuming your current path is within the application folder (where your package folders are), and your class files are not within a jar, you can do this. String OUTPUT_DIR = this.getClass().getCanonicalName().replace(".","/"); OUTPUT_DIR = OUTPUT_DIR.substring(0,OUTPUT_DIR.lastindexOf('/'));

Categories : Java

Why will Qt not create a text file when running or debugging from inside Qt, but will create it when directly from the debug folder?
You probably used a relative path, and inside QtCreator the "current directory" from where the executable is ran is not necessarily the directory where the executable is. Try: qDebug() << QDir::currentPath(); It will tell you where you should expect your file to be written.

Categories : C++

create zip file inside a folder but without folder inside that zip
@hek2mgl I have 'files.txt' inside 'images' folder, that's why it's happening Then your code will not work at all as the path to $File is wrong. Use this: $File = "images/files.txt"; $zip = new ZipArchive(); $filename = "./images/files.zip"; if ($zip->open($filename, ZipArchive::CREATE)!==TRUE) { exit("cannot open <$filename> "); } // use the second parameter of addFile(). It will give the file // a new name inside the archive. basename() returns the filename // from a given path $zip->addFile("$File", basename($File)); if(!$zip->close()) { die('failed to create archive'); }

Categories : PHP

To create a new folder in Qml
There's no way to create a directory directly from QML nor JavaScript. You will have to create an object in C++ and "export" it (make visible) to QML. Than you can call this object's method from your QML code and it will create the directory. The basic idea of connecting C++ and QML is covered here: Reading and writing files in QML The only thing you'd have to change is to exchange write method for createDir (or whatever you want) and insert your code. Another way to do it is to set contextProperty ex. QQmlContext *context; context = viewer.rootContext(); context->setContextProperty("DirManager", &dManager); (where DirManager is your class) and use macro Q_INVOKABLE before the return type of your method.

Categories : Java

How to create folder within project
Here's the easiest way to do this in Xcode: 1) Put all your images into a folder and then drag that folder into the list of files in your Xcode project. That step looks like this: 2) A sheet will drop down in Xcode and ask you how you want to add these files to your project. It looks like this: There's a checkbox at the top there that says "Copy items into destination group's folder (if needed). You will check this if you want to copy your folder full of images into the same place where your source code is found in your Xcode project. 3) When you're done adding, here is what your project should look like in Xcode. Notice that the folder color is blue. That means it's a folder reference. This folder will be copied into your built application.

Categories : Xcode

Create folder at particular path
Try: <?php $val = $_POST['prog1']; mkdir("/wars/".$val, 0777); ?> notice the wrong input prog1 !== prog2 attribute, also learn to do some simple debuging, like: <?php echo '<pre>'.print_r($_POST,true).'</pre>'; ?> Also enable error reporting on development. <?php error_reporting(E_ALL); ?>

Categories : PHP

Why wouldn't a folder exist after you create it?
The value in folder.Exists is cached. I would suggest doing this check: var doesItExists = Directory.Exists(folder.FullName); Or you could call folder.Refresh() to update the cache before checking if the directory exists after creating it. See this previous answer.

Categories : C#

Change storage folder when create zip
I have solved in this way: $new_zipname = substr($zipname,strrpos($zipname,'/') + 1); header('Content-Type: application/zip'); header('Content-disposition: attachment; filename='.$new_zipname);

Categories : PHP

asp.net create folder and file in other server
Though I don't know whether or not you're getting an exception at the moment, this is almost assuredly a permissions issue. IIS is going to send the credentials the Application Pool is running under when trying to create the folders. This is generally defaulted to NETWORK SERVICE. Have a look at the user the Application Pool is running under, then check out the permissions of the root folder, and ensure that user has Write access. Once the Application Pool user has permissions -you're good.

Categories : C#

Create Source Folder Programmatically
When you called javaProject.getPackageFragmentRoot(), you created a build path for the project using itself as the source folder. Skip it, you can just get the project-relative path from your IFolder instance and make your newSourceEntry from that.

Categories : Java

how to create alias folder on apache 2
That's the wrong way to do it. See the docs: http://httpd.apache.org/docs/current/mod/mod_alias.html You cannot set aliases in .htaccess, either.

Categories : PHP

How to create new res folder in Android Studio
I had the same problem, what I did was create a values-xx folder inside the main directory (main>>right click>>new>>directory) and then moved that folder to res/ directory. It's not beautiful but it is a workaround to create a folder with Android studio.

Categories : Android

Permission to create folder on iPhone
You cannot modify the contents of a compiled app's bundle folder. This is because the bundle is the compiled application. This prevents the possibility of malware modifying apps after install. Files generated at run time should be saved to the either Documents, Temp or Cache folders. These folders are only accessible to your app. No other app can access the contents of these folders. Sample Code : NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSError *error; [[NSFileManager defaultManager] createDirectoryAtPath:[documentsDirectory stringByAppendingPathComponent:@"yourFolderName"] withIntermediateDirectories:NO attributes:nil error:&error];

Categories : Iphone

Create a new folder by using OS notation in Java
Use String.valueOf(System.nanoTime) to generate folder name. It will generate unique folder name for every call. Then concat this folder name with base path and voila, you have a unique folder name. Use File.separator to separate base path and generated folder name. UPDATE: If folder names will be shown/selected via user interface, then aforecited approach could not be suitable. Then use a mask and number. For mask, let it be new folder (%n%). Where %n% will be generated number or date string. To check folder presence in your code use the following method: private static boolean doesFolderExist(String folderPath) { final File folderHandler = new File(folderPath); return folderHandler.isDirectory(); } But from my point of view I would ask user for a name for a new folder, ins

Categories : Java

How to create Folder in Remote Location
It should work on your server also, as long as you have permissions to create a folder in the specified directory. Why don't you try it and see? If you get an error, make sure to post the full error message.

Categories : C#

Vbscript webdav folder create
That response status (415 - Unsupported Media Type) means that the server has rejected the request entity. In your request the request entity is the XML. Note that a 'normal' MKCOL request does not use XML in the body, only extended MKCOL does, which is not implmented on all servers. So its most likely just that the webdav server that you're using does not support extended MKCOL http://tools.ietf.org/html/draft-ietf-vcarddav-webdav-mkcol-06

Categories : Vbscript

Create folder and directory in actionscript
If you are using Flash in a web browser, for security reasons there is not. the only option to store something locally within a web browser is to use shared objects (kind of like cookies), but this is likely not what you want. If you are not in a web browser you can use either AIR or a third party wrapper such as Multidmedia Zinc (for an additional cost). File options for AIR can be found here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html File options for Zinc can be found here: http://www.multidmedia.com/support/livedocs/zinc/4.0/ EDIT Since in your comment it sounds like your running in a web browser, you should leave it at simply streaming it to your server. If they have no internet connection there is no other good option other than

Categories : Actionscript

Moving files from one folder to a hot folder BUT only move one at a time when the hot folder is empty
Pretty sure this should do what you want in vbscript: Set objFS = CreateObject("Scripting.FileSystemObject") set objFolderA = objFS.GetFolder("c:Folder A") set objFolderB = objFS.GetFolder("c:Folder B") For each objFile in objFolderA.Files Do While True If objFolderB.Files.Count = 0 Then objFS.MoveFile objFile.Path, ojbFolderB.Path & "" Exit Do End If Loop Next

Categories : Batch File

separating Model folder, view folder and controller folder in codeigniter
I am not sure that you can move views and models to different locations but you can change the location of application folder to the location of your choice. You can move your application directory to different location and then open your index.php file and set the $system_folder and $application_folder variables with the new path values, preferably with a full path, e.g. '/www/MyUser/system'. Reference: http://ellislab.com/codeigniter/user-guide/installation/index.html Hope this is helpful.

Categories : Codeigniter

Is it possible to create a sub-folder directly through the GitHub web application?
Git only tracks files, not directories. So you can't have an empty directory, it mush have at least one file in it, in order to be in git. You can create a new file in a new directory through GitHub's web-interface. See this explanation. You can specify a new file in a new directory in the file name like directory/file.r or dir/subdir/file.r. If you don't want any code in the directory, you could add a blank file named README. P.S. That repo already has a directory R, you can see it here

Categories : Github

How to Create or edit a txt file in a folder in Java?
Make paths consistent if not the same. Instead of using string constants, use a single Java File object. You are using these 2 inconsistent prefixes: "c:/Users/Dave/Desktop/Saves/bob/" "c:/Users/Dave/Desktop/javafiles/Saves/" Also, you need to improve your exception handling and reporting. Log as much information as you can about the original exception and the corrective (or emergency) action your program is taking.

Categories : Java

Create backup folder with several directories and files
You can copy files with particular extensions that start with a specific string like this: For Each f In objFSO.GetFolder("C:Folder1").Files ext = LCase(objFSO.GetExtensionName(f)) If (ext = "mdb" Or ext = "mdd" Or ext = "vei") And LCase(Left(f.Name, 5)) = "dados" Then f.Copy "C:BCKdados" End If Next Another (perhaps simpler) option would be to check the file name with a regular expression: Set re = New RegExp re.Pattern = "^dados.*.(mdb|mdd|vei)$" re.IgnoreCase = True For Each f In objFSO.GetFolder("C:Folder1").Files If re.Test(f.Name) Then f.Copy "C:BCKdados" Next

Categories : Vbscript

Create a folder in disk and Burn Into it using IMAPI 2
you can use the method IFsiDirectoryItem::AddDirectory of the IFsiDirectoryItem interface to add a directory to the file system image on the optical media; and after that, retrieve it with IFsiDirectoryItem::get_Item method. For example: Instead of rootItem.AddTree(sourceDirectory,includeBaseDirectory); Replace with something like: rootItem.AddDirectory(directoryName); rootItem.get_Item(directoryName, newDirItem); You can create multiple directory levels (just call AddDirectory on the appropriate directory item instead of rootItem). Also, you may want to reuse existing directories on optical media if the directories already exist. You can do that by taking into account the error IMAPI_E_DUP_NAME ((HRESULT)0xC0AAB112L) returned when trying to get the directory...

Categories : C#

How do I create a Netbeans style Jar with all dependencies in a lib folder?
In your pom.xml file ... 1) Add this code to your project->properties node. This will define your main class in a central place for use in many plugins. <properties> <mainClass>project.Main.class</mainClass> </properties> 2) Add this code to your project->build->plugins node. It will collect all your jar dependencies into a lib folder AND compile your main class jar with the proper classpath reference: <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>copy-dependencies</goal> </goals> <configuration>

Categories : Java

How to create new directory in target folder with Maven
In your library, simply check if the target directory (and/or whatever sub-directory you're interested in) exists. If it doesn't just use File.mkdirs(...) and create it. That's what the maven-surefire-plugin is doing.

Categories : Java

Git : Unable to unlink / cannot create directory, on ignored folder
Finally found the solution here : Applying .gitignore to committed files It's apparently because some files inside has been commited one time, so they are in the repo. If I understand it right, that means it's very important to modify the .gitignore before commiting any file inside, otherwise it can be a mess !

Categories : GIT

How to create files inside a folder in python
Use os.path.splitext to strip the file extension. Something like this: if isfile(filename): dirname = os.path.splitext(filename)[0] if not os.path.isdir(dirname): os.mkdir(dirname) outfile = os.path.join(dirname, "hello.jpg") check_call(["convert", "-density", "150", "-trim", filename, "-quality", "100", "-scene", "1", outfile]) EDIT: To have the new directory in the current working directory and not in the parent directory of the input file, use os.path.basename() and os.getcwd(): dir_base = os.path.basename(os.path.splitext(filename)[0]) dirname = os.path.join(os.getcwd(), dir_base)

Categories : Python

How do I create a Google Drive folder with only a path name
Maybe something like this? function createFolderFromPathName(newFolder){ var paths = newFolder.split("/"); var curPath = ""; var folders = DriveApp.getRootFolder().getFolders(); var curFolder = DriveApp.getRootFolder(); var folder; for(path in paths){ var hasFolder = false; while(!hasFolder && folders.hasNext()){ folder = folders.next(); if(paths[path] == folder.getName()){ hasFolder = true; } if(hasFolder){ folders = DriveApp.getFolderById(DocsList.getFolder(curPath+paths[path]).getId()).getFolders(); curPath = curPath == "" ? paths[path] + "/" : curPath + paths[path] + "/"; curFolder = DocsList.getFolder(curPath); } } if(!hasFolder){ curFolder = curFolder.createFolder(paths[pa

Categories : Google Apps Script

Create a public folder in internal storage
From this post : Correct way: Create a File for your desired directory (e.g., File path=new File(getFilesDir(),"myfolder");) Call mkdirs() on that File to create the directory if it does not exist Create a File for the output file (e.g., File mypath=new File(path,"myfile.txt");) Use standard Java I/O to write to that File (e.g., using new BufferedWriter(new FileWriter(mypath))) Enjoy. Also to create public file I use : /** * Context.MODE_PRIVATE will create the file (or replace a file of the same name) and make it private to your application. * Other modes available are: MODE_APPEND, MODE_WORLD_READABLE, and MODE_WORLD_WRITEABLE. */ public static void createInternalFile(Context theContext, String theFileName, byte[] theData, int theMode) { FileOutpu

Categories : Java

how to search for folder name under media - or create one - django
def custom_path(instance, filename): path = os.path.join('upload', 'media', slugify(instance.student.user.username)) try: os.path.mkdir(path) except OSError: # path already exists pass Using slugify here in case the username contains some special characters that are not allowed as file name. os.path.mkdir will raise OSError if the directory already exists. Finally, os.path.join to correctly create a path and you don't need the filename component, since you are returning a directory path.

Categories : Python

how to create a custom filetype from a folder of files?
I have used zziplib ( http://zziplib.sourceforge.net/ ) in the past. I had no particular difficulty integrating it into my cross platform (windows, Linux, Mac OSX). I simply used a different extension to make it clear this was to be used with my program. So I could rename my *.lvl files to *.zip and open the file with 7zip, winrar, file-roller, etc... There are many other libraries too: Zlib - http://zlib.net/ - Doesn't have a file format but does use gzip. 7-zip SDK - http://www.7-zip.org/sdk.html - Supports LZMA, zip, bzip2 and a few others. Whatever you pick, be careful with licenses. zlib is known for its very liberal license, but some of these might be under the GPL, which depending on how you use it might require source distribution. You might also want to check out: Compression

Categories : C++

powershell create folder and AD permission from array
The way you have it written, $sec_groups is an array of formatted table entries. When you add the rule, you're trying to string-interpolate a table entry object and use it as the name of a group. To make $sec_groups an array of the names of the groups, change FT Name -HideTableHeaders to Select-Object -ExpandProperty Name in the second line: $sec_groups = Get-ADObject -SearchBase "ou=class,ou=Groups,ou=Colleague,dc=school,dc=edu" -LDAPFilter "(name=13_su*)" -ResultSetSize 10 | Select-Object -ExpandProperty Name However, since what you're doing to create the folders is working (implying that $sec_group on its own does convert cleanly to a string when used as an argument to -Childpath), you might be able to get away with just getting rid of the quotes around $sec_group when setting the ru

Categories : Security

How to create folder in directory in iphone and android
Take a look at the Cordova File API which is based on the W3C File API. It is used to read, write and navigate file system hierarchies. List Files and Folders In order to list/count the lists and files inside a directory you have to use the DirectoryReader object. Supported Platforms: Android BlackBerry WebWorks (OS 5.0 and higher) iOS Windows Phone 7 and 8 Windows 8 Example: function success(entries) { var i; for (i=0; i<entries.length; i++) { console.log(entries[i].name); } } function fail(error) { alert("Failed to list directory contents: " + error.code); } // Get a directory reader var directoryReader = dirEntry.createReader(); // Get a list of all the entries in the directory directoryReader.readEntries(success,fail); Create Directory In order

Categories : Jquery

To create multiple log files with log4j based on folder name
You can do that in two ways. The easiest is to add the variable they need in the VM arguments. e.g. adding the name of your directory: -Dfolder=E:/Logging/folderName The other way, if you can not add the argument, is to add programmatically. e.g.: public class ChangeFileTest { private static Logger LOG = Logger.getLogger(ChangeFileTest.class); static { // Get the appender Appender appender = LogManager.getRootLogger() .getAppender("theFileAppender"); if (appender instanceof FileAppender) { // The new filename String filename = "C:\tmp\newstout.log"; // Change the file ((FileAppender) appender).setFile(filename); ((FileAppender) appender).setAppend(true); // Use t

Categories : Java

How to create a folder and a file in my project root directory
If you want the directory of the executable or dll of your running application then: Dim spath As String spath = System.IO.Path.GetDirectoryName( _ System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) If (Not System.IO.Directory.Exists(Path.Combine(spath, "test"))) Then System.IO.Directory.CreateDirectory(Path.Combine(spath, "test")) If (Not System.IO.File.Exists(Path.Combine(spath, "testoutput.txt"))) Then System.IO.File.Create(Path.Combine(spath, "testoutput.txt")) End If End If If you want the solution/project directory then: Dim spath As String = Directory.GetCurrentDirectory If (Not System.IO.Directory.Exists(Path.Combine(spath, "test"))) Then

Categories : Vb.Net

Why does Symfony create a separate vendor folder in my root?
That empty folder is generated when you don't pass the target-directory parameter to composer: php composer.phar create-project vendor/project target-directory [version]

Categories : Symfony2

How to create zip of multiple files (NOT FOLDER) in Windows Phone 8
You can use the compression library (Nuget package: Delay.GzipWebClient) described in this blog post which works in windows phone.

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.