Need To Detect Windows Vs Mac Files Upon User Upload
We have a need to ensure a user is uploading an acceptable file format (image artwork). The company only supports Windows and would like to know if it's possible to discern between Windows and Mac. Then let the user know the file was acceptable or not.
Is file platform detection possible with PHP?
View Complete Forum Thread with Replies
Related Forum Messages:
User Being Able To Upload Files
I am having trouble in the user being able to upload files. The file gets stored in the file which is suppose to, But the reference name of the file is not recorded in the database table. Code:
View Replies !
Nobody User When Upload Files On Web Server
This time I've got a terrible big problem about the interaction between a PHP application and the web server filesystem. The PHP application has got many funtionalities, such as uploading small image or text documents, creating directories, and so on. Once I log on the web server filesystem, I notice that all the files have been uploaded correctly, but their ownership is of "nodody" user, "nobody" group and 754 permission. I would like such files should have the same owner of the web files on the server, i.e. "pippo".
View Replies !
Upload Files From A User And Store Them In A Dtabase.
I currently have a page that allows me to upload files from a User and store them in a dtabase. Once the submit button is pressed, the PHP page appears, and lists the results of the Upload (i.e. Size, Name, Type). What I am wondering is if there is a way that when I press the submit button ,the actual file that was uploaded will be displayed in the PHP page in addition to the other results so that all can be seen at once? (i.e. a Mind Manager file - .mpp)
View Replies !
Detect Windows
to detect Windows Close Button. I have a popup that has two selections, Agree and Disagree. I want the user to make a choice so he musn't click the X button located at the top right corner of the page.
View Replies !
Detect User
How detect if user is surfing my site with a mobile phone? It would really help me to optimize my big site to make the surfing(fast loading) easier for mobile users.
View Replies !
Detect What Option The User Selected And Then Direct That User To The Selected Page.
Quick question regarding HTML forms and select fields. I want to be able to detect what option the user selected and then direct that user to the selected page. <select> <option name="1">1.html</option> <option name="2">2.html</option> </select> when the user selects, 1.html, it'll direct them to http://www.domain.com/1.html same with 2.html. I wasn't sure if this was done with PHP or Javascript, if its possible on both, which is better?
View Replies !
Downloader Can't Detect User Cancel
I have setup up a website for a client who has downloadable content. One of the things I've implemented is a downloader, which works fine for direct downloads and redirected downloads. Recenlty they decided that download links should have an expiry date, and a limit on the number of times a person can download from it. I've setup both, and everything works fine, under normal circumstances. Code:
View Replies !
Using $_SERVER['HTTP_REFERER'] To Detect What The User Typed
i have a unique problem. i own 2 domains... say my-domain.com and my-domain.org my-domain.com is hosted at yahoo domains(this is forwarded to the my-domain.org site) and i run a dedicated server where i host the .org domain... The problem is, i want to redirect my-domain.com/subdir/ to my-domain.org/subdir right now my-domain.com/subdir/ gets forwarded only to my-domain.org/ yahoo wont let me forward to anything but just the .org site... is there way to do the forward i want to using $_SERVER['HTTP_REFERER'] to detect what the user typed in and use it to do a redirect based on location.header..
View Replies !
Use PHPs Upload Feature To Upload Files To My Server Via A Webpage
I'm trying to use PHPs upload feature to upload files to my server via a webpage. Is there a max file size that can be uploaded? Right now my app seems to freeze on anything bigger then 20k. Here is the form I'm using to submit: <form action="index.php?viewBy=uploadEmail" method="post" enctype="multipart/form-data"> <input type=file name=cdFile> <input type=hidden name=MAX_FILE_SIZE value=24000><br><br> <input type=submit value=" Upload Email List "> </form> I'd like to be able to upload files of around 200k in size.. is this possible?
View Replies !
Upload_tmp_dir - Upload Files Stored In The Same Directory With Upload Script
I have a problem when I upload files: if try to upload files stored in the same directory whith upload script it is ok, it uploads them on the ftp. IF I select a file from another directory than the one with tha php script I get an error: uploadPHP Warning: ftp_put(langtxt-update.sql) [function.ftp-put]: failed to open stream: No such file or directory in D:Atlanticmooncollaudiftp_upload.php on line 35. I tried to set the upload_tmp_dir in the php.ini to c/Windows/Temp/ - that is the default. I tried phpinfo() and it is set. Trying $_FILES["file"]["tmp_name"] I get the correct path. After many tryes to understand why I get an error, I changed again upload_tmp_dir, hit an phpinfo() and it changed. At $_FILES["file"]["tmp_name"] in the script I get the default: windows/temp. What is the problem?
View Replies !
Image Resize On Upload - Upload Multiple Files
I need to upload multiple files but the code im currently working with (I didn't start it) is giving me a hard time. What i need is that every image selected is uploaded as is and resized to fit my needs. I do not want to show messages to the user (unless they are sending mp3's and such)... I really need some help, been trying to get this done for hours and hours now Code:
View Replies !
PHP Upload In Windows
I have php and apache running in Windows XP. I am trying to use various file upload scripts but none of them work. When I try to use ones that use a copy function I get the following error: Warning: copy(C:serverxitamiwebpageshivangPhotoGallery empimg3e710f87bf1ed.jpg) [function.copy]: failed to create stream: No such file or directory in C:serverxitamiwebpagesshivangPhotoGallery est.php on line 46 File could not be stored. Anther script I tried does the following: // Open the uploaded file $file = fopen($img1, "r"); // Read in the uploaded file $fileContents = fread($file, filesize($img1)); // Escape special characters in the file $fileContents = AddSlashes($fileContents); The above script fileContents only has half the image. I have the upload_tmp_dir set to c:serverupload and file_uploads to yes.
View Replies !
Max Upload On Windows
I have an upload script for my client. The max upload in the php.ini is set to 2M..as standard. I tested it on a linux server and by editing the .htaccess file I can increase the max upload filesize. That doesn't work on the windows server. So i tried this <input type="hidden" name="upload_max_filesize" value="16000" /> and this <input type="hidden" name="upload_max_filesize" value="16M" /> and this <input type="hidden" name="post_max_size" value="16M" /> <input type="hidden" name="upload_max_filesize" value="16M" /> <input type="hidden" name="max_execution_time" value="600" /> I can't get anything to work. Is there a set way to increase the max upload on a windows server?
View Replies !
User Authenticaton On A Windows Box
I grabbed some code from a website I have running on linux box that works, and put it on a Windows server that I loaded PHP 5 on. I'm getting the below error when bringing up the login page. Anyone know what it means. I tried googling it.
View Replies !
Upload Questions - Upload 20 Files At One Time
I've a FORM to upload 20 files at one time, I want it upload 50MB without any problem. I need to set PHP execution to high time, I think, I use ini_set(). But, how can I specify maximum of 50MB, I've an array of 20 files in a FORM. Next I think, it's bad to allow 50MB, should I step-down to 10MB or what?
View Replies !
Create An Upload For Visitors To Upload Files
I am trying to create an upload for so that visitors to my site can upload files, I am doing th form in 2 stages, the first stage the user will upload the file, then in the second stage the user will fill out a form with information about the file. Now, here is what I am trying to do, I have a session variable name $ufile and when a user uploads the file I would like to update this variable with the name of the file they uploaded so that it can carry over to the form and they will not have to manually fill in a URL for the download location. I have the upload form working fine, but I can not seem to update the $ufile variable in the upload form, depending on where I try to update it the variable either clears to nothing or just does not update (I give the variable a value on creation for testing). Here is my download script, this is everything before the <head> tag that processes the form. Exactly where and how would I update the $ufile seesion variable to be the same as $file_name: Code:
View Replies !
PHP 5 Windows File Upload
I need to define a loaction for file for uploads. I am using Win server 2003 PHP 5. I have edited my php.ini to define a location for uploads. upload_tmp_dir=/somedir/somesubdir/ I restarted my server and I still get no value for upload_tmp_dir. Any ideas what's wrong?
View Replies !
File Upload On Windows
This is really the first time I have ever had to work with PHP on Windows. I seem to be running into a problem I never have on linux. The following code show the correct directory in which the image should be moved to, but it fails. It shows the correct path and is_uploaded_file is a success. Code:
View Replies !
PHP Windows Domain User/machine
Is there a way for a PHP script to know which machine/user is accessing the script? The html headers at best show the client machine name/IP but not the user. so... Can AciveX be used to see who is logged in? Can COM etc be used? If this is not possible through the use of apache+php, can any other application server beside iis + asp be used like tomcat? I'd ideally like page A to be displayed if logged in user is A, page B is displayed if logged in user is B. PHP will not be authenticating the user (spoof is possible and OK), but user can be logged into any machine.
View Replies !
Find Current Windows User
I'm looking to create a internet site. My idea is to use the login name (the windows one) instead of making the user re-enter there login and user name again. I've searched around, but I can't seem to find a anyway of using php to retieve the current logged in user (I know you can find it using .asp and vb.net).
View Replies !
File Upload Mac Os X Fine, Windows Xp Not ?
I've written a simple CMS (the file upload is handled by code I found here) for a site I'm working on and I thought everything was working ok until I tested it on a pc. I always get the same error on the pc which is something I wrote so that only normal jpg's would be uploaded, not progressive jpgs (this is because the site has a flash front end and flash can't load in progressive jpg's dynamically). I added some more error checking in the php file, and a very strange thing is occuring. I have tried uploading the EXACT same jpg from both my mac and pc, on the mac it uploads fine, resizes etc etc but on the pc it doesn't and in my error message it says that the file is a 'image/pjpeg'? Does a pc think a normal jpg is a prgressive jpg ??? How can the jpg change file types? this is really weird!
View Replies !
Upload Script On Windows Not Working
I am trying to write an upload script that will upload files to a certain directory. I am testing this on my windows desktop under apache if it makes a difference. Part of the target path is what the user posts to create a new directory for the uploaded file to be put into: Code:
View Replies !
Coding For Windows To Upload To Linux
I'm trying to remember what code I had that would work on a Linux server but not on my apache php mysql install on a Windows machine. Does anyone know of instances of this? Someone I know doesn't believe that this is the case because they believe that php is truly cross platform. I realize that for most code it does work on Windows and Linux but I think there are exceptions that need to be noted.
View Replies !
Capturing User Login Information Of Windows
I want develop the intranet site with seamless authentication. Is there any way to capture only the user name who has logged in the windows machine. Iam using PHP 5.0 MySQL and IIS Server. I have tried with $_SERVER['LOGON_USER'] but its returning nothing.
View Replies !
Detecting A Logged In Windows Domain User Id
Is there a method ($_SERVER?) to detect the id the user is logged into a Windows domain with? For instance, if I go to a desktop in my workplace and login to a Windows domain, then hit the web site, I want that web site to know the user id I used to log into the Windows domain.
View Replies !
Windows INI Files
Are there any PHP scripts for handling windows style INI files ie [section] one = great two=not very good etc [next section] Also how do you handle multi-selects from an input field on a form.
View Replies !
PHP Exec() And Zipping Upload File In Windows
I have the following code. What I need is to zip the file (c:webuploadsomeFile) to d:websomeFile.zip. $cmd = 'c:zipzip.exe '. $movedFile. ' '. $finalFile; exec( $cmd, $cmd_output ); File is being uploaded by the apache server, but it's not being zipped. My guess "", escaping, is causing problem in windows path. Do I also have to escape the $movedFile content? Forexample $movedFile= "c:webuploadsomeFile".
View Replies !
Inculde Files Under Windows
I have just discoverd that php under windows does not support the include function. The sites navigation is based on include files in the php, however it is being hosted on a windows nt box, not my choice but unfortunately it was the clients. Does anyone know of a quick or usefull work around for this?
View Replies !
Files Don't Show On Windows/MSIE
I am attempting to download files (usually images) for viewing with either the user's browser or a program associated with the file type. Unfortunately, this requires that it works in MSIE (works ok with Mozilla and Opera) but when I attempt to use MSIE it offers a choice of either opening it or saving. Opening the message, causes the image viewing program to state that the file is not a valid jpeg (I'm using jpegs for testing presently). And when I select "Save", nothing is downloaded. I'm already losing my hair, so please save the hair! The afflected code: header("Content-type:" . $row['mime_type']); header("Content-length:" . $row['size']); header("Content-Disposition: attachment;filename=" . $row['filename']); header("Pragma: no-cache"); header("Expires: 0"); $fa = fopen("/tmp/attach/" . $row['id'],"rb"); $buffer = fread ($fa, $row['size']); echo $buffer; I've also tried: $fa = fopen("/tmp/attach/" . $row['id'],"rb"); echo fread ($fa, $row['size']); fpassthru($fa) or die("Unable to read file!"); ************************************
View Replies !
Problem With Including Files In Windows
did all of the development originially on linux - everything works great. started moving it over to windows, i can't even get the main page to load. i have 2 files included on the index.php page: 1. ) config.php - houses db connection function & some sql functions 2. ) functions.php - has functions to display data based on what page you're on, etc. the problem is i can't include the config file. index.php times out after 30 or 60 seconds; without it, i have alot of code to fill in all over the application. i made some small changes to it, even tested it again on the linux box and it still works, however when i test it on the Windows machine it, as stated, times out. when i don't include config.php, the page loads alright, just with "call to undefined function: sql() in c:inetpubwwwroothtmlincfunctions.php on line 23" scattered where i have my db calls.
View Replies !
SAFE_MODE And Executing Files Using PHP On Windows
I have the following in php.ini: safe_mode = 1 safe_mode_exec_dir = "D://TEST" This way I can execute files located in TEST. However, running the following code bypasses that directory and runs stuff from other locations: $runCommand = "C:WINDOWSsystem32shutdown.exe -t:30"; $WshShell = new COM("WScript.Shell"); $output = $WshShell->Exec($runCommand)->StdOut->ReadAll; How do I prevent people from executing ANYTHING unless it is located in safe_mode_exec_dir?
View Replies !
Accessing Files/dir On A Windows Network
I need to access files on a Windows network. So basically the location would be serverdir1dir2 or something like that. I'm running this PHP script on a different server (call it serv2) that runs IIS. My code is something like this: $dir = "serverdir1dir2"; if (is_dir($dir)) { echo "IS DIR! "; if ($dh = opendir($dir)) { /*More stuff*/ It doesn't even recognize it as a directory. Now I figure the problem is authentication. Basically all users in a domain (call it 'allusers') can access server and these files. But the scripts in serv2 (the one where PHP runs) is authentication anonymously using the account ISUR_SERV2, which is an account local to the serv2 server and not in the domain 'allusers'. So I tried authenticating just this script using an account in the allusers domain (my own). However it still doesn't work. And I know for a fact that serv2 is connected to the network.
View Replies !
Having Problems Running Some Files On Apache For Windows
I am running Apache 2 for windows and have PHP installed and working fine on the server. However, some of the php scripts and programs i have do not use the <?php starting tag, the use <? instead, and as a result of this, the script does not execute. Can anyone tell me how i can configure apache to allow both <?php tag and <? aswell?
View Replies !
Upload Script: Failed To Open Stream: Permission Denied In Windows NT
i've put an upload script on my site, hosted on a Windows NT Version 5.0 server. When i try to upload something i get an error: copy(files/file.txt): failed to open stream: Permission denied in d:sitesmatita.bewebsiteuploaded.php on line 20 Could not copy The problem is that i am not able to change the permissions, since it's a windows server. CHMOD is not supportes, CACLS neither. Is there a way out, or is it up to the server admin to install some 'permission system'?
View Replies !
Problems Uploading Files Using Apache And Php On A Local Windows PC.
I've got some problems uploading files using apache and php on a local Windows PC. I'm using the file upload example from the manual, but i can't get it to work. I don't get an error message, it's asif nothing happens. I can't find the file that should be uploaded on my harddisk. Has anyone a working example for file-uploads on a local server with the settings for the php.ini file? Any tips?
View Replies !
Automatic Download Of Files Using Application/save On Windows XP SP2 Browsers
For the past two years, we have offered files for download through a secure website. Users, after clicking on a link, are redirected to a PHP page that passes the appropriate header information to the user and inquires if that user wishes to download the file. A sample of that code is below: header('Content-Type: application/save'); header('Content-Disposition:attachment; filename="'.$file_path .'"'); header('Content-Transfer-Encoding: binary'); header('Content-length: ' . filesize($full_file_path)); readfile($full_file_path); However, with the enhanced security now available in Windows XP SP2, users are no longer prompted to download the file. In fact, Windows XP SP2 not only suppresses the download but will not even present the end user with an option to download the file. Has anyone else encountered this type of situation? If so, is there a programmtic solution to, at the very least, prompt the user to download the file without requiring the user include the website as one of his/her trusted websites.
View Replies !
Allow User To Verify Upload
I have a simple upload script that allows users to upload images. I'd like to have a step in between the form submit and the actual upload that prints the users choice to the screen and allows them to verify their choice. Normally I pass the variables w/ hidden form fields but it doesn't work with an uploading image. Any suggestions on how I can allow a user to verify before uploading?
View Replies !
User Image Upload
Does anyone know how to allow a user to upload an image to a folder on a server and insert the URL of the image into a MySql database? Basically what I want to do is have a image uploader that inserts into a sql database table. If anyone knows how to do this.
View Replies !
User Input And Upload
I am currently working on a site which is run with PHP using ODBC. On one of the pages i have products stored in my MS Access db for sale displayed in a list. At the bottom of that list I have a form for the user to fill out containing 3 text fields, one called 'customer number', the second called 'item number' and the third 'quantity'. By default the 'item number' field shows 4 fields but using javascript a user can click 'add another' and another renamed unique field opens up. My problem is i have no idea how to get the form to upload the users data to my MS Access database. I can quite easily get the customer number to upload but im not sure what code to use to say, when more than one 'item number' field is generated upload that information too! Code:
View Replies !
Session Files (text Files) Deleted After Sometime When User's Session End
In developing a recent project, I want to implement a feature, that certain query results will be written to a text file, after the user's session end for twenty minutes, the text file will be deleted automatically. I know in win/IIS/asp how to config this feature, but no idea how to do these in linux/apache/php. Php manual's session_save explain is not helpful enough. Anybody have such experience??
View Replies !
User Photo Upload Via Site
I want my users to be able to upload photos, and I know how to code that part. But I'm not sure how to make them easily accessible to my scripts after. Here's the problem as I see it. I have enough sense not to make any of my public_html directories writeable. Therefore when a file is uploaded, I figure it needs to go in a folder in the root that has php-writable permissions. But then my scripts have to reference it like: "../../photos/file.jpg" and it won't have an absolute address available by browser. There's gotta be a good way to make publicly available photo uploads, right?
View Replies !
|