kandi X-RAY | coursepress Summary
kandi X-RAY | coursepress Summary
coursepress
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get raw object data
- Save module data
- Get list of fonts .
- Decode an ASCII - 8 encoded string
- Main function .
- Calculates the pagination
- Render the show media caption field
- Render the post form
- Output the widget .
- Assign capabilities to a user
coursepress Key Features
coursepress Examples and Code Snippets
Community Discussions
Trending Discussions on coursepress
QUESTION
My cousin and I built a WordPress plugin for CoursePress that will take in a list of email addresses, and add them as users/students into a course.
We have used this plugin on multiple occasions without fail, but one client of ours told us that the plugin would not work for them. I have screen shared and verified that they are using the plugin correctly.
The plugin takes in a .csv file in "Email,FirstName,LastName,CompanyName" format, adds users based on that data, adds those users as students to selected course, and prompts you to download a new .csv file that will contain user names and passwords from created users.
You can see the code HERE
My initial thought was that Windows and Mac/Linux save .csv files with different line endings, so maybe that is the problem, but I sent this person a file that I saved through my MacBook and instructed to not open the file but to just try to use it in the plugin to see if it works. Still nothing.
I have made some edits in the uploads.php file to try to narrow down the problem, but I am not making any progress.
In the edits below, I am trying to see if the "uploaded_file" post variable is empty, and if it is, to tell me it is. The current error my client is having is "There was an error during file validation!". I am pretty sure his error should be reading the $ers variable from below, but I cannot get it to give me that error when I submit the form without a file.
Can anyone help me?
...ANSWER
Answered 2017-Feb-21 at 20:19The problem lies in your checkFile()
function. The function is using the $_FILES['userfile']['type']
as a part of validation. However, as stated in the documentation:
$_FILES['userfile']['type'] - The mime type of the file, if the browser provided this information.This mime type is however not checked on the PHP side and therefore don't take its value for granted.
Therefore, different browsers may send different values or no value at all, so you can't depend on it.
You can probably just remove that from your check on this line:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install coursepress
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page