Phpmywind modifies the upload image path.

Source: Internet
Author: User
Phpmywind modifies the upload image path. I want to modify the address of the uploaded image to the server. the actual path in the foreground input box is correct. I want to know where to modify the upload path?


Reply to discussion (solution)

Paste the uploaded file

Paste the uploaded file

Upload. class. php file

Oh, that is to say, I want to download this stuff too? You don't have to do this for another person.
Forget it.

The 122 rows of the file contain
$ Save_url = 'uploads/'. $ upload_url.'/'. $ filename;
Change it to what you need.

Oh, that is to say, I want to download this stuff too? You don't have to do this for another person.
Forget it.

The 122 rows of the file contain
$ Save_url = 'uploads/'. $ upload_url.'/'. $ filename;
Change it to what you need.

Here I changed it. after that, the path displayed in the front-end input box is correct. The path is not uploaded in the background. sorry, the following is common. inc. php, I think, is to modify this file without knowing where to modify it.




/*
**************************
(C) 2010-2014 phpMyWind.com
Update: 13:47:05
Person: Feng
**************************
*/

Define ('phpmywind _ Inc', preg_replace ("/[\/\] {1 ,}/",'/', dirname (_ FILE __)));
Define ('phpmywind _ root', preg_replace ("/[\/\] {1,}/", '/', substr (PHPMYWIND_INC, 0, -8 )));



Define ('phpmywind _ data', PHPMYWIND_ROOT. '/data ');
Define ('phpmywind _ TEMP ', PHPMYWIND_ROOT.'/templates ');
Define ('phpmywind _ upload', PHPMYWIND_ROOT1. '/upload ');

Define ('phpmywind _ backup', PHPMYWIND_DATA. '/backup ');
Define ('in _ PHPMYWIND ', TRUE );


// Check externally passed values and escape them
Function _ RunMagicQuotes (& $ svar)
{
// PHP5.4 has removed this function
If (@! Get_magic_quotes_gpc ())
{
If (is_array ($ svar ))
{
Foreach ($ svar as $ _ k = >$ _ v) $ svar [$ _ k] = _ RunMagicQuotes ($ _ v );
}
Else
{
If (strlen ($ svar)> 0 &&
Preg_match ('# ^ (cfg _ | GLOBALS | _ GET | _ POST | _ SESSION | _ COOKIE) #', $ svar ))
{
Exit ('The requested variable value is not allowed! ');
}

$ Svar = addslashes ($ svar );
}
}
Return $ svar;
}


// Directly apply variable name substitution
Foreach (array ('_ get',' _ Post') as $ _ request)
{
Foreach ($ _ request as $ _ k => $ _ v)
{
If (strlen ($ _ k)> 0 &&
Preg_match ('# ^ (GLOBALS | _ GET | _ POST | _ SESSION | _ COOKIE) #', $ _ k ))
{
Exit ('The requested variable name is not allowed! ');
}

$ {$ _ K} = _ RunMagicQuotes ($ _ v );
}
}


Require_once (PHPMYWIND_INC. '/config. cache. php'); // global configuration file
Require_once (PHPMYWIND_INC. '/common. func. php'); // global common functions
Require_once (PHPMYWIND_INC. '/conn. inc. php'); // introduce the database class


// Introduce the database class
If ($ cfg_mysql_type = 'mysqli '&&
Function_exists ('mysqli _ init '))
Require_once (PHPMYWIND_INC. '/mysqli. class. php ');
Else
Require_once (PHPMYWIND_INC. '/mysql. class. php ');


// Session save path
$ Sess_savepath = PHPMYWIND_DATA. '/sessions /';
If (is_writable ($ sess_savepath )&&
Is_readable ($ sess_savepath ))
Session_save_path ($ sess_savepath );


// Upload file storage path
$ Pai_image_dir = PHPMYWIND_UPLOAD;
// $ Export _soft_dir = PHPMYWIND_ROOT. '/upload ';
// $ Pai_media_dir = PHPMYWIND_ROOT. '/upload ';


// System version number
$ Pai_vernum = file_get_contents (PHPMYWIND_DATA. '/version/version.txt ');
$ Pai_vertime = file_get_contents (PHPMYWIND_DATA. '/version/vertime.txt ');


// Set the default time zone
If (PHP_VERSION> '5. 1 ')
{
$ Time51 = $ pai_timezone *-1;
@ Date_default_timezone_set ('etc/GMT'. $ time51 );
}


// Determine whether an error message is enabled
If ($ pai_diserror = 'y ')
Error_reporting (E_ALL );
Else
Error_reporting (0 );


// Determine the access device
// If you manually change the background Directory, change the/admin directory to the new background directory.
If (IsMobile ()&&! Strstr (GetCurUrl (), '4G. php ')&&
$ Pai_mobile = 'y '&&! Strstr (GetCurUrl (), '/admin '))
{
Header ('Location: 4G. php ');
}

?>

What is the value of PHPMYWIND_UPLOAD?

What is the value of PHPMYWIND_UPLOAD?

This is the original download path. I didn't change it.

In common. inc. php
Define ('phpmywind _ upload', PHPMYWIND_ROOT. '/uploads ');
$ Pai_image_dir = PHPMYWIND_UPLOAD. '/image ';
$ Pai_soft_dir = PHPMYWIND_UPLOAD. '/soft ';
$ Pai_media_dir = PHPMYWIND_UPLOAD. '/media ';
So this is where it should be modified.

The upload. class. php 122 line
$ Save_url = 'uploads/'. $ upload_url.'/'. $ filename;
Ying writing
$ Save_url = basename (PHPMYWIND_UPLOAD). '/'. $ upload_url. '/'. $ filename;
In order to ensure that the physical path and url path are consistent

In common. inc. php
Define ('phpmywind _ upload', PHPMYWIND_ROOT. '/uploads ');
$ Pai_image_dir = PHPMYWIND_UPLOAD. '/image ';
$ Pai_soft_dir = PHPMYWIND_UPLOAD. '/soft ';
$ Pai_media_dir = PHPMYWIND_UPLOAD. '/media ';
So this is where it should be modified.

The upload. class. php 122 line
$ Save_url = 'uploads/'. $ upload_url.'/'. $ filename;
Ying writing
$ Save_url = basename (PHPMYWIND_UPLOAD). '/'. $ upload_url. '/'. $ filename;
In order to ensure that the physical path and url path are consistent

I set define ('phpmywind _ upload', PHPMYWIND_ROOT. 'here to the server address' in common. inc. php ');
Upload. class. php row 122 $ save_url = basename (PHPMYWIND_UPLOAD). '/'. $ upload_url. '/'. $ filename; it is difficult to modify the file.

Echo PHPMYWIND_UPLOAD;
See what it is

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.