473,503 Members | 2,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Upload failure

15 New Member
here is my code that is supposed to upload files and save it to web server but somehow didn't work. Please help. I'm new in php and I'm using version 4

$thumb_loc = "../Folders/".$myfolder."/";
$thumb_loc = $thumb_loc.basename($myfile);
if (!file_exists($thumb_loc)){

if (move_uploaded_file($myfile,$thumb_loc)){
echo "<script language='javascript'> location.href='default.php?message=File uploaded&method=list';</script>";
}
else{
echo "<script language='javascript'> location.href='default.php?message=Uploading failed&method=list';</script>";
}
}
else{
echo "<script language='javascript'> location.href='default.php?message=File already exists&method=list';</script>";
}
Jan 30 '08 #1
1 1229
Markus
6,050 Recognized Expert Expert
What happens and what doesnt happen?
What is $myfile?

try this tutorial.
Jan 30 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2083
by: Courtney L. | last post by:
I tried to search for this issue on the group, but don't even know where to start, so here's my problem. We have a very simple form which has a file upload box. Upon submit the file should be...
2
2239
by: lawrence | last post by:
The following upload script seems to be working on PCs but not on Macs. Can anyone imagine a reason why? Could there be something in the form that turns in flawed data, or could IE on a Mac not...
0
227
by: Jim Heavey | last post by:
Hello, I am following along with an example of how to do uploads and download from your application. The download seems to wok just fine, but the upload does not. Each time I attempt to upload,...
1
3261
by: igotyourdotnet | last post by:
Ok, here is the issue: I have 2 web pages one does a file upload to a database and the other page does a FTP to a server, both pages use the c:\temp directory. The page that uploads to a database...
6
3031
by: Vic Spainhower | last post by:
Hello, I am trying to do a FTP file upload which works fine on my localhost but on my ISP server it fails. I can't seem to find where I can go to find the specific cause of the failure. In both...
0
990
by: ABC | last post by:
How to delegate IIS's FTP File Upload and Upload Failure Events from C#?
8
8752
by: VUNETdotUS | last post by:
My goal is to upload files without submitting the form. I am not looking for the code here but rather a concept. I did a little research and discovered that I can submit a form to an invisible...
12
2509
by: jodleren | last post by:
Hi I have an app, where I should upload files... Problem: when e.g. uploading 14MB (just 10MB) the page will load, then go back to the original page.... by some reason I cannot upload large...
5
3263
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
1
4860
by: chennaibala | last post by:
can any one send me mutiple image upload program and save the file name with extension in mysql table.we must cheak uploaded file type like bmp or any image file while uploading. i develop...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3168
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.