Questions tagged [directory]

In a digital filing system, a directory serves as a storage unit where multiple computer files and directories can be stored and arranged in an organized manner.

What is your preferred approach to arranging files that are being echoed from a specific directory?

I have implemented a code that displays files in a directory if they are songs. However, these songs appear in a list without any specific order. I would like to organize them based on their file names. Interestingly, when I check the same files in FileZil ...

What is the best way to link to a CSS file located in a different directory while being in a subdirectory?

For a project I am working on, I am developing a simple streaming site and have organized my files into different folders. These folders include: HTML CSS Shows Within the "Shows" folder, there is a subfolder named "Testshow". I am facing an issue with ...

Processing Images Using PHP

I recently developed a script that enables users to upload multiple images of their vehicles. The images are then processed and the file paths are stored in a database, while a folder is created inside my 'vehicleImages' directory to store the im ...

What is preventing me from importing files from a directory labeled 'individuals'?

Currently, I am working on a MEAN app and encountered some issues with my Angular folder structure. Here are the errors I am facing: https://i.stack.imgur.com/UAliy.png Interestingly, when I changed the name of the 'users' folder to something else like 'u ...

Retrieve a list of files that match a specific pattern in PHP and organize them based on the oldest file

Suppose there is a directory with the following list of files: Something_2015020820.txt something_5294032944.txt.a something_2015324234.txt Something_2014435353.txt.a The goal is to retrieve a list of files sorted by the oldest date (not filename) and on ...

Node is throwing an error that it is unable to find the view "index" in the "views" directory, which may vary depending on the current directory in the shell

During the development of my Node.js project, I encountered an issue with running my index.js file. Specifically, when I navigate to the root directory of my project and execute $ node index.js, an error is raised stating: Error: Failed to lookup view " ...

Navigate to the parent directory from the absolute path

Is there a way for me to go up one directory from an absolute path? Here is my file structure: /folder/ /folder/config.php /folder/classes/test.php In test.php, I need to include_once or require_once the config.php file. I attempted this in test.php, a ...

Tools needed for Angular project development

Currently, I am engaged in a project using AngularJS on a Windows 7 computer. My desire is to be able to seamlessly transition between working at the office and working from home or any other location. If I have everything installed in a folder named C:/C ...

PHP - Retrieve files from a network shared folder

Within my shared network, I have the ability to access every server using my user account. I developed a PHP script in Wamp and now need to access a folder within my shared network. While I can access it directly using the path \128.xx.3.199\sh ...

Creating nested directories in PHP using arrays: A step-by-step guide

When working with Laravel, I encountered an issue while trying to create a trait file using the console. The problem arises when specifying a directory for the file creation - it does not get created as expected. The structure of the directory can be dyna ...

Python's counterpart to sprintf

Any suggestions on how to convert this PHP function into Python? /** * Converts an ID (media ID) to the corresponding folder in the data-storage * e.g.: Default mp3 file with ID 120105 is stored in * /(storage root)/12/105/default.mp3 * If absolute ...

Exploring Directory Files Using PHP

I have a code snippet that pulls all the files from the image folder on the server and displays them in a dropdown menu. $dir='images'; $list=scandir($dir); if(isset($_POST['submit'])) echo 'Selected: ' . $_POST['imag ...

Unable to generate a subdirectory within a directory on Ubuntu through PHP

Is there a way to use PHP to create a folder? I attempted to create a folder within /var/www/php but it did not work. What could be causing this issue? This is the code I used: <?php $path=getcwd.'/images'; mkdir($path,777); ?> Can someone identi ...

"Utilizing Node.js to access modules with their absolute

My directory structure is as follows: -- app/ |- models/ |- user.js |- config.json I am trying to make my user.js file require the config.json. Currently, I am using require('/config') but it doesn't seem to be working. Can som ...

When the PHP script attempts to create a folder, it encounters an error preventing it from successfully creating

I have been scouring through various sources like Stack Overflow and Google for hours, but I still can't seem to find a solution. While I've found some related information, nothing seems to be resolving my issue. Below is the code snippet in que ...

The inability of Chrome and Firefox browsers to open Windows folders directly from a hyperlink is a common

My link is directing to a Windows folder using its directory path. Surprisingly, it works perfectly fine in Internet Explorer but fails to work in Chrome and Firefox. How can I resolve this issue? The structure of my link looks like this: <a href="\d ...

Create a directory layout similar to that of Google Drive

I need assistance with designing the database structure for a directory table. I would like to allow users to create folders or subfolders and organize their files accordingly. While I have looked at the Microsoft installer directory table, I am concerne ...

Displaying the contents of every file within the given directory

I'm facing a challenge where I need to access a directory and display the content of all files within it. for fn in os.listdir('Z:/HAR_File_Generator/HARS/job_search'): print(fn) Although this code successfully prints out the names of the files, my g ...

Linking HTML files across different directories

Here is the current structure of my folders: de/ index.html en/ index.html hu/ index.html img/ image.png style/ stylesheet.css I am wondering how I can link to the css file in the style folder and the image in the img folder directly ...

converting the names of files in a specific directory to a JavaScript array

Currently working on a local HTML document and trying to navigate through a folder, gathering all the file names and storing them in a JavaScript array Let's say I have a folder named Videos with files like: - VideoA.mp4 - VideoB.mp4 How can I cre ...

Navigating Up a Directory with JQuery

Is there a way to navigate up one directory level in my jQuery code? The code below is referencing a folder named "uploads" on the C drive, but I can't find any mention of "uploads" in my HTML. How does it know to look there? And how can I go back to ...

The Enchanted URL Folder Name

Spent two painstaking hours dealing with this issue. It's incredibly frustrating. Struggling to load css files in PHP pages when the URL contains a folder named "adsq" Comparing two identical pages, only differing in the folder name: One works perf ...

Is there a way to display and output the data from a file?

I'm currently working on a program that opens a file and displays its contents. I'm running into issues with defining it, I think? Either I get an error saying "path" is not defined or "new_dir" is not defined. Below is the code: import pathlib def prog_ ...

What is the best way to retrieve files from a specific folder using file names saved in a python list?

I have a large collection of excel files, close to 10k in total, stored in a folder. Additionally, I have a python list containing nearly 8k filenames. My goal is to extract the files from the folder that match the filenames in the list, and then transfer ...

Access the folder in Command Prompt along with the directory of the present folder

Whenever I click on the "Open in Command Prompt" option within Visual Studio Code for the selected folder (C:playground g2app), it should open up in the command line. However, when I check the path in the command prompt, it only displays C:. Here is ...

The PHP script designed to generate a hierarchical array containing all files within a directory and its subdirectories is experiencing difficulties

I'm currently trying to utilize a custom function that I found on the PHP manual website (shared by a user). This function is designed to generate a nested array containing all files and folders within a specified directory on your server. Since I am ...

Deleting items from an array of files and directories with PHP

Currently, I am attempting to retrieve a list of directories within a specified path using the scandir method and then removing any files from the resulting array. However, I am encountering issues with my echo statement. The code snippet I am working on ...

Python code to manage image files in a directory: "Maintain a designated number of images within a directory by using Python to

In my dataset, I have three main folders named Train, Test, and Val. Each of these folders contains over 100 subfolders. My goal is to only keep a maximum of 90 images in each folder. If a particular subfolder has more than 90 images, I need to delete th ...

EJS file not displaying stylesheets and images correctly during rendering

I'm currently in the process of building a website, but when I try to render an ejs file (index.ejs), only the HTML portion is displayed without showing any stylesheets, fonts, or images. Here is the code snippet for linking the stylesheets: <!D ...

Is there a way to store a folder structure into an array using PHP?

I have a directory structure that looks like this: top folder1 file1 folder2 file1 file2 My goal is to convert it into an array format as shown below: array ( 'folder1' => array('file1'), 'folder2' => array( ...