Wrox Programmer Forums
|
BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
This is the forum to discuss the Wrox book PHP and MySQL: Create-Modify-Reuse by Timothy Boronczyk, Martin E. Psinas; ISBN: 9780470192429
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 31st, 2011, 09:03 AM
Registered User
 
Join Date: Mar 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 6 ajax

I cant get that thing working. All I get is a blank manager screen with no files.(there are files in that folder:)
I know for a fact that my non-relative path is
"/home/server_name/ftp/folder/folder" ...I 've tried every possible combination but it's no working...

I've read about the upload issue but for starters I cant see the files at all...
 
Old April 2nd, 2011, 11:53 AM
Authorized User
 
Join Date: Jul 2009
Posts: 77
Thanks: 4
Thanked 6 Times in 6 Posts
Default

Hi blackflow,

Make sure your php.ini file is set up correctly.
You need to have file_uploads = On
and an upload_tmp_dir.

file_uploads = On
upload_tmp_dir = /usr/home/myname/myfiles


One approach would be to do a simple file upload and see
if that works. W3schools has a nice sample program to do
a basic file upload.

http://www.w3schools.com/PHP/php_file_upload.asp

Try that first.
Then, in the upload_file.php program they provided, try adding in
a call to the move_uploaded_file function.
Gradually, try to replace their upload_file.php program
with your upload.php (as much as you can).

The way the file transfer works is the file gets uploaded to the upload_tmp_dir
you specified in your php.ini file; it has some temporary name.
Then the call to move_uploaded_file moves that file to your target directory.
The following link discusses this in detail (See PROBLEM 2)

Chap 2 - Avatars and uploading files, (would apply to Chap 6 too)

The idea is to verify that you can move the files you want to upload
to the correct destination directory.

Now, I am not quite clear on what you are seeing on your
screen. Do you have a row of buttons along the bottom?
Is one of those buttons an upload button? When you press
the upload button it will output to the screen a text field, a browse
button, an Ok button and a cancel button. Do you see this
on your screen? If so, then when you browse for a file and click the okay
button, you should see the file appear in the window above.
The file should also be in the target directory.

There was an error in chapter 6. Getting around it is
discussed in the following link. I know you said you read it,
but for other readers, it is.

Chapter 6, Ajax File Manager, error in upload.php file

I hope this helps.
 
Old April 2nd, 2011, 02:14 PM
Registered User
 
Join Date: Mar 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i worked it out...I was using the files from the books main page.(single file download) instead of the newer ones (split in to chapters)...and it worked.

but do you know by any chance if so, how to change the DEFINE in config.php to a variable so the script would work?. I've tried it but when i change the DEFINE for a variable the script loads but doesn't show files inside the folder...





Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX code needed for Chapter 7 Fenlander BOOK: Professional ASP.NET MVC 2 1 November 24th, 2010 10:05 AM
Starting Ajax Chapter 10 btcomp BOOK: Beginning ASP.NET 4 : in C# and VB 4 September 24th, 2010 03:28 PM
problems with ajax/Chapter 7 Luba BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 0 March 12th, 2010 08:36 AM
Chapter 10 - Ajax try it out VeganMan BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 5 May 2nd, 2008 05:11 PM
Chapter 6 : Web Services and Ajax 2mk BOOK: Professional Ajax ISBN: 978-0-471-77778-6 1 February 11th, 2008 04:21 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.