473,406 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Errors uploading files, files won't upload

1
Expand|Select|Wrap|Line Numbers
  1. <?
  2. $instituto=$_POST['instituto'];
  3.  $carrera=$_POST['carrera'];
  4.  $materia=$_POST['materia'];
  5.  $titulo=$_POST['titulo'];
  6.  $paginas=$_POST['paginas'];
  7.  
  8.  $formato=".pdf";
  9.  $direccion=$instituto."/".$carrera."/".$materia."/".$titulo.$formato;
  10.      if(isset($_FILES['documento']) && $_FILES['documento']['type']=='application/pdf'){
  11.         move_uploaded_file ($_FILES['documento']['tmp_name'] ,$direccion );
  12.         header('Location:adminfinal.php');}
  13.  
  14.  
  15. $base= new PDO('mysql:host=localhost; dbname=prueba','root','');
  16. $base->exec("set character set utf8");
  17. $sql="INSERT INTO id_libro (instituto,carrera,materia,titulo,paginas,direccion) VALUES (:ins,:ca,:ma,:ti,:pa,:di)";
  18. $resultado=$base->prepare($sql);
  19. $resultado->execute(array(":ins"=>$instituto,":ca"=>$carrera,":ma"=>$materia,":ti"=>$titulo,":pa"=>$paginas,":di"=>$direccion));
  20. ?>```
  21.  
Oct 10 '19 #1
0 1232

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

Similar topics

4
by: dickiedyce | last post by:
Hi there. I've spent the weekend getting ever more frustrated, trying to get an upload file function working on a website. The site is hosted by a company called oneandone. They're using PHP...
4
by: msnews.microsoft.com | last post by:
Hi, I hope we can upload only files with limited size through ASP scripts(<2MB). I need to write an ASP script that can serve up to 100MB of file uploading. I have written one script(with...
2
by: Jason | last post by:
Hi I have this web application for an intranet. I would like to be able to upload 1 or more files from the client machine. for example: the client is working with 10 files and after he is done...
1
by: Mahesh | last post by:
Whenever you upload files via HTTP Post, the file is stored in the memory of the aspnet_wp.exe process, and never deallocates completely (if you are lucky a few MB gets released). One of the config...
4
by: Corey Erkes | last post by:
I am using ASP.Net with C# as the code behind and am trying to upload multiple files with the HTMLInputFile Control. I am able to browse, select a file, and finally upload, but only one file at a...
2
by: FusionGuy | last post by:
I've created a file uploading handler, implemented as an httpHandler. Each time I attempt to upload a file, or files, my HttpContext.Request.Files property never contains the files that were...
3
by: Dean Richardson | last post by:
Hi, I'm having trouble uploading files via a PHP script. Whenever I upload a file greater than 10K, the file gets corrupted. However, text files upload OK. When I check the FTP Server log I...
0
by: jw01 | last post by:
I am using the following example code to upload a file to a weberver. I get Decleration exepected errors. Can anyone tell me how the subroutine will be defined for this code. And what are the bugs in...
221
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application...
0
by: LoriFranklin | last post by:
I'm a bit of a newbie here. I've learned a lot from reading the posts you all have here. I need some help uploading files using an asp form. I am using some code that I found from Jacob at...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.