Place media attachment in other directory (Wordpress) - wordpress

My client is using an old media attachment URL for their email signature logotype. This image has now been removed and I would like to upload the same image again and place it in the same directory as before, recreating the URL.
However, when I upload a new media file to Wordpress, the file automatically is placed in a directory that corresponds with the current date: .../wp-content/uploads/2018/09. I would like to place it in the directories .../wp-content/uploads/2015/09/.
Is it safe to manually create these folders and upload the file via FTP or would the manually added files be overwritten or removed in some way upon updating Wordpress? If so, is there some other way to change the date of a media attachment and automatically create the correct folders depending on the date I change it to?

If there isn't a folder "2015" in your /wp-content/uploads you can add this folder through your FTP program, same goes for the monthly folder. If the folder for the year and/or month are already there you can just upload the image to the desired folder by using your FTP program.

Related

Delete Images From WordPress Media Library

I am unable to view any of the media library documents in the grid view. I can see them in the normal list view. I am also unable to upload any new media files. I have noticed that there are some strange no title files which I think are the cause of the issue but i am unable to delete them as there is no edit or delete button next to any of these screen-shot. My question is is there a way to delete these odd files from the database?
WordPress media files are not actually stored in the database. They are stored under a folder structure in your web root folder.
If you can make an FTP login, you can get rid of the odd media files as follows:
Make FTP login
Navigate to the wp-content/uploads folder
Under the uploads folder, you will find folder/s like 2016, 2015 etc. (depending on how old your site is)
Within each year, you will find monthly folders
Within each monthly folder, you will find the media files (that you uploaded during that month/year)
Browse around to find the offending files and delete
Hope this works for you.
Edit: You can also try one of the following plugins:
https://wordpress.org/plugins/enhanced-media-library/
https://wordpress.org/plugins/media-library-plus/

Upload all wordpress file together using filezilla, without skipping any one of the file

I am trying to upload my wordpress website to my 000webhost.com hosted website using filezilla.
Problem : After uploading the wordpress folder completely, filezilla is skipping many of the crucial files is also not storing the failed files under "FAILED TRANSFER"
Is there any setting in filezilla such that it does not skip any file and tranfers all the files within folder's recursively?
FileZilla's default may be set to skip the file if a file of the same name already exists on the server (upload folder).
You can change this behaviour under the Transfer menu options, select the Default File Exists Action, and a dialog pops up, there are a number of choices of what to do by default, I would suggest amending the Uploads section to be Overwrite file if source file newer.

move dynamically uploaded files in asp

I am having a application that uploads files according to the user input..i just want to move that particular file to moved to another folder..
Now i am able to move the files to the destination folder..but it moves all the files which is already there in the folder..
i am creating a folder dynamically while uploading the files..and i need that file to be moved to that created folder...
I need to move only the uploaded file during run time...
E:\Export Documents - Copy\Uploads this path to C:\inetpub\wwwroot
this is my code
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
strDir = "c:\inetpub\wwwroot\" & fldr
oFS.CopyFile "E:\Export Documents - Copy\Uploads\*.jpg", "c:\inetpub\wwwroot\" & fldr
What you probably want to do is identify the file you have just uploaded and then move that. If you are already creating a folder to store the files in in inetpub, you might as well do the same in Uploads, and then just move that folder.
You will probably find it helpful to use fileSystemObject.MoveFolder instead of .CopyFile so that your Uploads folder does not fill up.
If you want some help with how to do that, post the code you are using to upload your file.
For working with the FileSystemObject, this is a useful reference
On another note, is it really wise to move files from Uploads into wwwroot? A malicious user could do some damage in there.

How to Set File-Location for Files Uploaded using NeatUpload

Salvete! When we set up the asp.net file-uploading control called "NeatUpload", it saves its files to a temporary location, either "YOUR_APP_ROOT /app_data/NeatUpload_Temp/", if the directory is writable, or to the system's temp folder. However, the demo does not seem to actually upload any files, nor does it include an example for saving the files to a particular directory.
How do we save the file we have uploaded and move the uploaded file to a particular folder? My only clue from the documentation is that it has to do with UploadStorageProvider, but I need some help to implement this.
if you read the documentation 3.3 point 6 :
In your codebehind file, process the uploaded file. If you are using
the InputFile control, the uploaded file's client-specified name, MIME
type, and contents can be accessed via inputFileId.FileName,
inputFileId.ContentType, and inputFileId .FileContent, respectively.
If you want to keep the uploaded file, you must use the
inputFileId.MoveTo()method to move the uploaded file to a permanent
location. If you do not, NeatUpload will automatically remove the
uploaded file at the end of the requestto ensure that unwanted files
do not fill up the filesystem. The following code will put the
uploaded file in the application's root directory (assuming sufficient
permissions):
and so on. I hope this is what you are after.

where does drupal save images when you use cck and imagecache?

I am thinking in moving all JS and images from webserver to another server to mitigate the load on my webserver. then i will use parallel module to get this stuff from the other server.
now, currently i am using cck and imagecache modules. and i dont know where does drupal save the images.
i checked mysql (files table) and found something like this
Mysql>select filepath from files limit 2;
sites/default/files/2010413132344592734_2.jpg
sites/default/files/2010491910913580_5.jpg
i checked for such files but i didnt find anything like this in this directory!!
i inspected one of the images in one of my articles and found that this image is in one of the cache folders that have been generated automatically by imagecache module. i tried to delete this image from server and refreshed my page, imagecache recreated it.
now where did imagecach get this image from? where does drupal save my images??
Thanks for your help
Imagecache takes source images from whatever path is set in the files table, which is generally sites/default/files, the directory you listed. Your imagecache directory was within that directory, right? I think your files are probably in that directory and you just missed them for some reason. Directory listing cached in your FTP client, maybe?
For myself, it stores everything in the sites/default/files folder.
But, some settings to look at...
The File system path setting, located at ?q=admin/settings/file-system
The path settings for the particular field. Open the settings for the particular field, and look in the File path setting in the Path Settings fieldset.
If those settings are different, your file may be somewhere else. Otherwise, it's going to be in your sites/default/files folder.
Check the following locations
[...]\htdocs\drupal\sites\default\files\field\image
[...]\htdocs\drupal\sites\default\files\styles\large\public\field\image
[...]\htdocs\drupal\sites\default\files\styles\medium\public\field\image
[...]\htdocs\drupal\sites\default\files\styles\thumbnail\public\field\image
where [...] is the location of the htdocs folder inside your webserver container.
If you are using xampp then it could be C:\xampp183\htdocs............
Hope this helps !
In the drupal database, check the table "file_managed" and the column "uri" (which gives the uri to access the file either local or remote).
You might find a value like below .. (ignore the jpg name , that is only for my setup)
public://field/image/8_mayurkotlikar_tigress5.jpg
This shows the location of the image.

Resources